From 57eaa6500c8afacc43b4dd301e6ff7123ee2fe48 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 28 Oct 2009 09:26:04 +0100 Subject: [PATCH] exclude: avoid an unwarranted warning * lib/exclude.c (excluded_file_name): Initialize "rc" before switch. --- ChangeLog | 5 +++++ lib/exclude.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 793ae5062..54a79e86e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-28 Jim Meyering + + exclude: avoid an unwarranted warning + * lib/exclude.c (excluded_file_name): Initialize "rc" before switch. + 2009-10-27 Eric Blake fseek: avoid compilation failure when fflush is replaced diff --git a/lib/exclude.c b/lib/exclude.c index 3ceeed7be..310c5abc2 100644 --- a/lib/exclude.c +++ b/lib/exclude.c @@ -412,7 +412,9 @@ excluded_file_name (struct exclude const *ex, char const *f) excluded to included or vice versa. */ for (seg = ex->head; seg; seg = seg->next) { - bool rc; + /* Pacify gcc, so it doesn't issue a spurious + "may be used uninitialized" warning. */ + bool rc = excluded; switch (seg->type) { -- 2.11.0