Fix: iterator.c: initialize `status` (may be used uninitialized)
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 1 Oct 2019 18:17:44 +0000 (14:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Oct 2019 18:14:29 +0000 (14:14 -0400)
From this GCC warning:

    iterator.c: In function ‘find_message_ge_ns_from_origin’:
    iterator.c:1611:9: error: ‘status’ may be used uninitialized in this
                              function [-Werror=maybe-uninitialized]
     1611 |  return status;
          |

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: If6f5f8a63d5a530284a08b9c6dd7f67ecfc9a818
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2120
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/lib/graph/iterator.c

index 511a1f981ba020c18c91285ba4e139d17b806f64..29cf279d691d5b68f49a668743ca2d28646adb50 100644 (file)
@@ -1542,7 +1542,7 @@ int find_message_ge_ns_from_origin(
                struct bt_self_component_port_input_message_iterator *iterator,
                int64_t ns_from_origin, GHashTable *stream_states)
 {
-       int status;
+       int status = BT_FUNC_STATUS_OK;
        enum bt_self_component_port_input_message_iterator_state init_state =
                iterator->state;
        const struct bt_message *messages[MSG_BATCH_SIZE];
This page took 0.025484 seconds and 4 git commands to generate.