From cd754680a6a0e35b286d4157269053ccc3996a32 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 13 Jan 2021 13:23:10 +0100 Subject: [PATCH] src/tests: avoid "-Wmaybe-uninitialized" warning in nmtstp_acd_defender_new() With gcc-10.2.1-9.fc33.s390x we get a (false positive) warning: src/platform/tests/test-common.c: In function nmtstp_acd_defender_new: src/platform/tests/test-common.c:2688:15: error: probe may be used uninitialized in this function [-Werror=maybe-uninitialized] 2688 | *defender = (NMTstpAcdDefender){ | ^ src/platform/tests/test-common.c:2656:56: note: probe was declared here 2656 | NAcdProbe * probe; | ^ --- src/platform/tests/test-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c index 6014204371..4e08b282b0 100644 --- a/src/platform/tests/test-common.c +++ b/src/platform/tests/test-common.c @@ -2653,7 +2653,7 @@ nmtstp_acd_defender_new(int ifindex, in_addr_t ip_addr, const NMEtherAddr *mac_a nm_auto(n_acd_config_freep) NAcdConfig * config = NULL; nm_auto(n_acd_unrefp) NAcd * nacd = NULL; nm_auto(n_acd_probe_config_freep) NAcdProbeConfig *probe_config = NULL; - NAcdProbe * probe; + NAcdProbe * probe = NULL; int fd; int r; char sbuf_addr[NM_UTILS_INET_ADDRSTRLEN];