From da2475084f73e371756539a5da696d6ec5e187ce Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 14 Jun 2021 11:18:19 -0400 Subject: [PATCH] Silence warnings on GCC 4.8 with -Wmaybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We still build on SLES12 with GCC 4.8 in which '-Wmaybe-uninitialized' doesn't seem to be the sharpest tool in the shed. Add explicit initialization of 'ret' to silence the warnings. Change-Id: I1f9de535b6be48357735af106ff555ab9eceb730 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/action-executor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/action-executor.c b/src/bin/lttng-sessiond/action-executor.c index 8b8aba761..14ac8103b 100644 --- a/src/bin/lttng-sessiond/action-executor.c +++ b/src/bin/lttng-sessiond/action-executor.c @@ -748,7 +748,7 @@ static void *action_executor_thread(void *_data) DBG("Entering work execution loop"); pthread_mutex_lock(&executor->work.lock); while (!executor->should_quit) { - int ret; + int ret = 0; struct action_work_item *work_item; health_code_update(); @@ -983,7 +983,7 @@ error_unlock: static int add_action_to_subitem_array(struct lttng_action *action, struct lttng_dynamic_array *subitems) { - int ret; + int ret = 0; enum lttng_action_type type = lttng_action_get_type(action); const char *session_name = NULL; enum lttng_action_status status; -- 2.34.1