Fix various "may be used uninitialized" warnings (GCC)
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 18 Jul 2019 04:17:21 +0000 (00:17 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 18 Jul 2019 13:42:13 +0000 (09:42 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I22634b22121dd32ddfdf1309e10e4f413263572d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1720
Tested-by: jenkins <jenkins@lttng.org>
src/ctf-writer/stream-class.c
src/ctf-writer/trace.c
src/lib/graph/iterator.c
src/plugins/utils/trimmer/trimmer.c

index ffec66557f991456a8ecdf4a8dfc4f09731e247f..ac3db47a1ff430fa71e461f8753417e1945af3d8 100644 (file)
@@ -613,7 +613,7 @@ int init_packet_context(struct bt_ctf_stream_class *stream_class)
                bt_ctf_field_type_structure_create();
        struct bt_ctf_field_type *_uint64_t =
                get_field_type(FIELD_TYPE_ALIAS_UINT64_T);
-       struct bt_ctf_field_type *ts_begin_end_uint64_t;
+       struct bt_ctf_field_type *ts_begin_end_uint64_t = NULL;
 
        if (!packet_context_type) {
                BT_LOGE_STR("Cannot create empty structure field type.");
index 56a9a55f81df4a6b9b7db8b45bf9cc7c3b23b945..e9a96247cdfd78900d7e8769d0ffe522931e4ccf 100644 (file)
@@ -899,7 +899,7 @@ int bt_ctf_trace_common_add_stream_class(struct bt_ctf_trace_common *trace,
        struct bt_ctf_field_type_common *packet_context_type = NULL;
        struct bt_ctf_field_type_common *event_header_type = NULL;
        struct bt_ctf_field_type_common *stream_event_ctx_type = NULL;
-       int64_t event_class_count;
+       int64_t event_class_count = 0;
        struct bt_ctf_trace_common *current_parent_trace = NULL;
        struct bt_ctf_clock_class *expected_clock_class =
                bt_ctf_object_get_ref(init_expected_clock_class);
index 3ae5920851c9af08986c67a5fb678acd3d07882c..a8fe3f15a95a8dc05a47938900aa5664fd22ca71 100644 (file)
@@ -1450,7 +1450,7 @@ int auto_seek_handle_message(
                         * as we don't know if items were really
                         * discarded within the new time range.
                         */
-                       uint64_t new_begin_raw_value;
+                       uint64_t new_begin_raw_value = 0;
 
                        ret = bt_clock_class_clock_value_from_ns_from_origin(
                                msg_disc_items->default_end_cs->clock_class,
index 79ceed0a9a79bf5ab29d262fc217f5d757d27bf5..a6889adf783ed25b428834492f7dba46fd4011ff 100644 (file)
@@ -1598,7 +1598,7 @@ bt_component_class_message_iterator_next_method_status handle_message(
        bt_component_class_message_iterator_next_method_status status;
        const bt_stream *stream = NULL;
        int64_t ns_from_origin = INT64_MIN;
-       bool has_ns_from_origin;
+       bool has_ns_from_origin = false;
        int ret;
 
        /* Find message's associated stream */
This page took 0.028829 seconds and 4 git commands to generate.