From a7f7d1bde43fc825c49afea3f946f5b4b3d563e0 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 27 Mar 2015 12:02:49 +0100 Subject: fix gcc warnings about uninitialized variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^ --- src/test/test-path.c | 2 +- src/test/test-pty.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/test-path.c b/src/test/test-path.c index 4f9f5c1344..a3295aa997 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -33,7 +33,7 @@ static int setup_test(Manager **m) { char **tests_path = STRV_MAKE("exists", "existsglobFOOBAR", "changed", "modified", "unit", "directorynotempty", "makedirectory"); char **test_path; - Manager *tmp; + Manager *tmp = NULL; int r; assert_se(m); diff --git a/src/test/test-pty.c b/src/test/test-pty.c index eadecb99a0..b5f4d4f094 100644 --- a/src/test/test-pty.c +++ b/src/test/test-pty.c @@ -95,7 +95,7 @@ static void run_parent(Pty *pty) { static void test_pty(void) { pid_t pid; - Pty *pty; + Pty *pty = NULL; rcvsiz = 0; zero(rcvbuf); -- cgit v1.2.3-54-g00ecf