From: Philip Withnall Date: Wed, 8 Feb 2017 15:53:01 +0000 (+0000) Subject: test: Fix a maybe-uninitialised compiler warning (#5269) X-Git-Tag: v233~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a909d41e1835a77ff65fe93002245faaaf6047a;p=thirdparty%2Fsystemd.git test: Fix a maybe-uninitialised compiler warning (#5269) The compiler warning is a false positive, since n_addresses is always initialised on the success path from parse_argv(), but the compiler obviously can’t work that out. Fixes: src/test/test-nss.c:426:9: warning: 'n_addresses' may be used uninitialized in this function [-Wmaybe-uninitialized] --- diff --git a/src/test/test-nss.c b/src/test/test-nss.c index 4ccfe751473..b59cb7aa694 100644 --- a/src/test/test-nss.c +++ b/src/test/test-nss.c @@ -511,7 +511,7 @@ int main(int argc, char **argv) { _cleanup_free_ char *dir = NULL; _cleanup_strv_free_ char **modules = NULL, **names = NULL; _cleanup_free_ struct local_address *addresses = NULL; - int n_addresses; + int n_addresses = 0; char **module; int r;