This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 <mjw@redhat.com> 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).
> >
> > libiberty/ChangeLog:
> >
> >         * cp-demangle.c (d_substitution): Change struct demangle_component
> >         variable name from c to dc.
> >         * configure.ac (ac_libiberty_warn_cflags): Add -Wshadow.
> >         * configure: Regenerate.
> 
> The patch to cp-demangle.c is OK.  Thanks.
> 
> 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 build break if some system
> header file defines a global variable that happens to have the same
> name as a local variable.  It's not a likely scenario but I don't see
> a need to court a build breakage.

OK, pushed with just the cp-demangle.c fix.
We'll pick up and shadow warnings when we update the valgrind copy again.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]