From e4265826e636834fa6ee86cc2873bd99e36ccea5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 14 Jul 2020 17:15:49 -0400 Subject: [PATCH] Clean-up: relayd: unused tcp keep alive config return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc 10.1.0 reports: tcp_keep_alive.c: In function \u2018tcp_keep_alive_init\u2019: tcp_keep_alive.c:519:9: warning: \u2018removed_return.58\u2019 is used uninitialized in this function [-Wuninitialized] 519 | return tcp_keep_alive_init_config(&support, &config); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tcp_keep_alive_init is a constructor and, as such, should not return a value. GCC warns that its return value is unused (although with a somewhat strange warning message). The return value of tcp_keep_alive_init_config is ignored as all error paths log a suitable error and not much more can be done. Signed-off-by: Jérémie Galarneau Change-Id: I912fe7e6c817edf77dd26bc7e18c0a14a9cbe94e --- src/bin/lttng-relayd/tcp_keep_alive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-relayd/tcp_keep_alive.c b/src/bin/lttng-relayd/tcp_keep_alive.c index dc8cf2fb3..81d085024 100644 --- a/src/bin/lttng-relayd/tcp_keep_alive.c +++ b/src/bin/lttng-relayd/tcp_keep_alive.c @@ -513,10 +513,10 @@ error: /* Initialize the TCP keep-alive configuration. */ __attribute__((constructor)) static -int tcp_keep_alive_init(void) +void tcp_keep_alive_init(void) { tcp_keep_alive_init_support(&support); - return tcp_keep_alive_init_config(&support, &config); + (void) tcp_keep_alive_init_config(&support, &config); } /* -- 2.34.1