ctf: silence bogus warning in set_field_refs()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 11 Sep 2019 14:57:15 +0000 (10:57 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 14:45:10 +0000 (10:45 -0400)
gcc 9.1.0 warns that struct_fc my be used uninitialized. The code
flow doesn't allow this to happen, but this warning is annoying/scary
and easily fixed by initializing struct_fc to NULL.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ib4c702dfc0ca4a29e387b384a1603bdf4634c599
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2028
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c

index 5e5a2c5426f5eecf6711c94d105848d6db0c01af..4a4bbeee259785d67249dc83fd22ac29ead3fb74 100644 (file)
@@ -1501,7 +1501,7 @@ int set_field_refs(struct fs_sink_ctf_field_class * const fc,
        {
                uint64_t i;
                uint64_t len;
-               struct fs_sink_ctf_field_class_struct *struct_fc;
+               struct fs_sink_ctf_field_class_struct *struct_fc = NULL;
                struct fs_sink_ctf_field_class_variant *var_fc = NULL;
                struct fs_sink_ctf_named_field_class *named_fc;
 
This page took 0.02544 seconds and 4 git commands to generate.