Fix -Wjump-misses-init warnings
[babeltrace.git] / src / plugins / ctf / fs-sink / fs-sink-trace.c
index 16d9241ac559bb6c8a5c8a7936c55169cc86c7dd..1bc01d2fe8755e6430993792899bd081acdd6ede 100644 (file)
@@ -133,6 +133,15 @@ GString *make_unique_trace_path(const char *path)
        return unique_path;
 }
 
+/*
+ * Disable `deprecated-declarations` warnings for
+ * lttng_validate_datetime() because we're using `GTimeVal` and
+ * g_time_val_from_iso8601() which are deprecated since GLib 2.56
+ * (Babeltrace supports older versions too).
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 /*
  * Validate that the input string `datetime` is an ISO8601-compliant string (the
  * format used by LTTng in the metadata).
@@ -162,6 +171,8 @@ end:
        return ret;
 }
 
+#pragma GCC diagnostic pop
+
 static
 int append_lttng_trace_path_ust_uid(const struct fs_sink_trace *trace,
                GString *path, const bt_trace *tc)
@@ -396,6 +407,7 @@ static
 GString *make_trace_path_rel(const struct fs_sink_trace *trace)
 {
        GString *path = NULL;
+       const char *trace_name;
 
        if (trace->fs_sink->assume_single_trace) {
                /* Use output directory directly */
@@ -410,7 +422,7 @@ GString *make_trace_path_rel(const struct fs_sink_trace *trace)
        }
 
        /* Otherwise, use the trace name, if available. */
-       const char *trace_name = bt_trace_get_name(trace->ir_trace);
+       trace_name = bt_trace_get_name(trace->ir_trace);
        if (trace_name) {
                path = g_string_new(trace_name);
                goto end;
This page took 0.025289 seconds and 4 git commands to generate.