From 6a909d41e1835a77ff65fe93002245faaaf6047a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 8 Feb 2017 15:53:01 +0000 Subject: [PATCH] test: Fix a maybe-uninitialised compiler warning (#5269) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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] --- src/test/test-nss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/test-nss.c b/src/test/test-nss.c index 4ccfe75147..b59cb7aa69 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;