Re: [PATCH] Fix -Wshadow warning in libiberty/cp-demangle.c

2016-11-14 Thread Ian Lance Taylor
On Sun, Nov 6, 2016 at 10:03 AM, Mark Wielaard wrote: > > We now have -Wshadow=local. So the attached patch uses that for > libiberty. Is the attached patch OK to commit? This is OK. Thanks. Ian

Re: [PATCH] Fix -Wshadow warning in libiberty/cp-demangle.c

2016-11-13 Thread Mark Wielaard
On Sun, Nov 06, 2016 at 07:03:34PM +0100, Mark Wielaard wrote: > On Sat, 2016-09-10 at 09:51 -0400, Eric Gallager wrote: > > On 9/10/16, Ian Lance Taylor wrote: > > > I'm not sure about the patch to configure.ac/configure. The last I > > > looked -Wshadow would warn if a local

Re: [PATCH] Fix -Wshadow warning in libiberty/cp-demangle.c

2016-11-06 Thread Mark Wielaard
On Sat, 2016-09-10 at 09:51 -0400, Eric Gallager wrote: > On 9/10/16, Ian Lance Taylor wrote: > > I'm not sure about the patch to configure.ac/configure. The last I > > looked -Wshadow would warn if a local variable shadows a global > > variable. That can cause a pointless

Re: [PATCH] Fix -Wshadow warning in libiberty/cp-demangle.c

2016-09-10 Thread Eric Gallager
On 9/10/16, Ian Lance Taylor wrote: > On Fri, Sep 9, 2016 at 5:06 PM, Mark Wielaard wrote: >> valgrind contains a copy of the libiberty demangler which gets compiled >> with -Wshadow. That shows the following warning: >> >> cp-demangle.c: In function

Re: [PATCH] Fix -Wshadow warning in libiberty/cp-demangle.c

2016-09-10 Thread Mark Wielaard
On Sat, Sep 10, 2016 at 01:57:54AM -0700, Ian Lance Taylor wrote: > On Fri, Sep 9, 2016 at 5:06 PM, Mark Wielaard wrote: > > Fix that by renaming the struct demangle_component variable to dc > > and add -Wshadow to ac_libiberty_warn_cflags (the only warning is this one). > > > >

Re: [PATCH] Fix -Wshadow warning in libiberty/cp-demangle.c

2016-09-10 Thread Ian Lance Taylor
On Fri, Sep 9, 2016 at 5:06 PM, Mark Wielaard wrote: > valgrind contains a copy of the libiberty demangler which gets compiled > with -Wshadow. That shows the following warning: > > cp-demangle.c: In function ‘d_substitution’: > cp-demangle.c:3772:35: warning: declaration of ‘c’

[PATCH] Fix -Wshadow warning in libiberty/cp-demangle.c

2016-09-09 Thread Mark Wielaard
valgrind contains a copy of the libiberty demangler which gets compiled with -Wshadow. That shows the following warning: cp-demangle.c: In function ‘d_substitution’: cp-demangle.c:3772:35: warning: declaration of ‘c’ shadows a previous local struct demangle_component *c;

Re: -Wshadow warning

2011-08-25 Thread Gabriel Dos Reis
On Wed, Aug 24, 2011 at 9:32 PM, Alan Modra amo...@gmail.com wrote: Wouldn't -Wshadow be more useful if it obeyed -Wno-system-headers? For code like        #include stdlib.h        int foo (int atof);        int foo (int atof) { return atof; } we currently do not warn on the prototype, but

-Wshadow warning

2011-08-24 Thread Alan Modra
Wouldn't -Wshadow be more useful if it obeyed -Wno-system-headers? For code like #include stdlib.h int foo (int atof); int foo (int atof) { return atof; } we currently do not warn on the prototype, but do on the function definition, leading to reports such as