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;
          |                                                        ^
This commit is contained in:
Thomas Haller 2021-01-13 13:23:10 +01:00
parent 9bef4ece92
commit cd754680a6
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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];