From 078c6db29bcf036e985f15a8b3790537b5f0f701 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 8 Feb 2023 10:08:11 +0100 Subject: [PATCH] apps/restconf: fix compiler warning 'addr' may be used uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Natvie build with GCC 11.3 generates the following warning. The patch is silly and the code path should never be reached, but it silences the compiler. restconf_main_native.c:572:9: warning: ‘addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Joachim Wiberg --- apps/restconf/restconf_main_native.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/restconf/restconf_main_native.c b/apps/restconf/restconf_main_native.c index afcb6d19d..246ed10d1 100644 --- a/apps/restconf/restconf_main_native.c +++ b/apps/restconf/restconf_main_native.c @@ -564,6 +564,9 @@ restconf_accept_client(int fd, addr = &(in6->sin6_addr); break; } + default: + errno = EAFNOSUPPORT; + goto done; } if ((rsock->rs_from_addr = calloc(INET6_ADDRSTRLEN, 1)) == NULL){ clicon_err(OE_UNIX, errno, "calloc");