From 08cdcf013938f0b8e9791236f51990ebe6db71ba Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 30 Apr 2019 11:24:11 -0400 Subject: [PATCH] Fix: maybe-uninitialized warning in create_relative_field_ref() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit translate-trace-ir-to-ctf-ir.c: In function ‘resolve_field_class’: translate-trace-ir-to-ctf-ir.c:302:6: error: ‘tgt_fc_name’ may be used uninitialized in this function [-Werror=maybe-uninitialized] g_string_assign(tgt_field_ref, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tgt_fc_name); ~~~~~~~~~~~~ translate-trace-ir-to-ctf-ir.c:177:14: note: ‘tgt_fc_name’ was declared here const char *tgt_fc_name; Signed-off-by: Francis Deslauriers Change-Id: I8d3398a852bf3ca412bb479eae72a81a3959d220 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1031 Reviewed-by: Philippe Proulx --- plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c b/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c index 24aa96ab..fe3725f8 100644 --- a/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c +++ b/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c @@ -174,7 +174,7 @@ int create_relative_field_ref(struct ctx *ctx, struct fs_sink_ctf_field_class *tgt_fc = NULL; uint64_t i; int64_t si; - const char *tgt_fc_name; + const char *tgt_fc_name = NULL; struct field_path_elem *field_path_elem; /* Get target field class's name */ -- 2.34.1