From b4a22ad2a9b7cf411161248f29c2d588cee11dea Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 17 Jul 2025 10:28:27 +0200 Subject: [PATCH] platform: fix compilation without LTO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following error seen when running the build_clean.sh script with LTO disabled: In file included from ../src/libnm-glib-aux/nm-default-glib.h:66, from ../src/libnm-glib-aux/nm-default-glib-i18n-prog.h:13, from ../src/core/nm-default-daemon.h:11, from ../src/core/platform/tests/test-link.c:6: In function ‘_nm_auto_freev’, inlined from ‘test_link_get_bridge_fdb’ at ../src/core/platform/tests/test-link.c:2732:33: ../src/libnm-glib-aux/nm-macros-internal.h:166:8: error: ‘addrs’ may be used uninitialized [-Werror=maybe-uninitialized] 166 | if (*p) { | ^ ../src/core/platform/tests/test-link.c: In function ‘test_link_get_bridge_fdb’: ../src/core/platform/tests/test-link.c:2732:33: note: ‘addrs’ was declared here 2732 | nm_auto_freev NMEtherAddr **addrs; | ^~~~~ cc1: all warnings being treated as errors Fixes: 16ef33d38095 ('bond-slb: fix memory leak') --- src/core/platform/tests/test-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/platform/tests/test-link.c b/src/core/platform/tests/test-link.c index 54d9dd7fb..fab6bd2ef 100644 --- a/src/core/platform/tests/test-link.c +++ b/src/core/platform/tests/test-link.c @@ -2729,7 +2729,7 @@ static void test_link_get_bridge_fdb(void) { const NMPlatformLink *link; - nm_auto_freev NMEtherAddr **addrs; + nm_auto_freev NMEtherAddr **addrs = NULL; int ifindex[2]; guint8 expected[][6] = { {0x00, 0x99, 0x00, 0x00, 0x00, 0x01},