From 5999d54a30e5a40ce619826e2efac5818b23d494 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 1 Oct 2019 14:17:44 -0400 Subject: [PATCH] Fix: iterator.c: initialize `status` (may be used uninitialized) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: If6f5f8a63d5a530284a08b9c6dd7f67ecfc9a818 Reviewed-on: https://review.lttng.org/c/babeltrace/+/2120 Tested-by: jenkins Reviewed-by: Francis Deslauriers --- src/lib/graph/iterator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/graph/iterator.c b/src/lib/graph/iterator.c index 511a1f98..29cf279d 100644 --- a/src/lib/graph/iterator.c +++ b/src/lib/graph/iterator.c @@ -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]; -- 2.34.1