[systemd-devel] [PATCH 4/5] shared:util : Remove shadow compile warning

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Oct 16 16:19:29 PDT 2014


On Fri, Oct 17, 2014 at 02:16:14AM +0300, Philippe De Swert wrote:
> Hi,
> 
> On 17/10/14 02:09, Zbigniew Jędrzejewski-Szmek wrote:
> > On Fri, Oct 17, 2014 at 12:43:52AM +0300, philippedeswert at gmail.com wrote:
> >> From: Philippe De Swert <philippedeswert at gmail.com>
> >>
> >> Removes the following compilation warning:
> >> src/shared/util.c: In function 'rm_rf_children_dangerous':
> >> src/shared/util.c:2800:22: warning: declaration of 'is_dir' shadows a global declaration [-Wshadow]
> >> In file included from src/shared/util.c:77:0:
> >> src/shared/mkdir.h:45:5: warning: shadowed declaration is here [-Wshadow]
> >> ---
> > What compiler version are you using? IIRC, gcc used to warn about
> > local variables shadowing globals and then stopped.
> 
> 4.7.3. Not exactly the latest and greatest. And as I stated in the cover
> letter these are most likely just cosmetic.

> Anyway not very important patches so if they seem more trouble than
> they're worth you can just skip them.
Well, importance is a relative. False warnings obscure useful warnings,
so they are not unimportant. But the diagnostics have improved in 4.8 and 4.9
quite a bit, and I don't think we should clutter code with workarounds
for compiler issues that are actually already fixed.

> The only "real" problem being the implicit declaration has apparently
> been fixed just 40 min after I sent my patchset.
Ah, OK, I'll then skip that patch too.

Zbyszek


More information about the systemd-devel mailing list