This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 18/348] Fix -Wsahdow warnings
On Wed, Nov 30, 2011 at 2:17 AM, Tom Tromey <firstname.lastname@example.org> wrote:
> Could we possibly mandate that -Wshadow only be used with a GCC that has
> Alan Modra's patch in it?
> Joel pinged it, and it went in, though I didn't see the actual patch:
> ? ?http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02340.html
I know I probably should go to GCC mailing list and ask that question
there, but anyways, would this patch cause gcc to stop generating the
warning about local variable shadowing global one from system headers?
The reason I'm asking is because there are several instances of said
shadowing in GDB, for example
(please ignore the erroneous description, for some unknown reason I
call `optarg' `optparse')
I hope that kinds of shadowing would still be detectable even with this
> Still, what it does is prevent the warning when shadowing something from
> a system header. ?This seems decent to me and in particular will, I
> think, largely address Mark's concerns.
It would pretty much solve that problem, yes, but still it would
divide patch submitters into two groups those who have newest gcc and
-Wshadow enabled by default, and those who don't. And the people
without -Wshadow enabled compilers would be, on occasion, breaking the
build because they have no means to check for -Wshadow caused errors.
I hope I missing something and it is not the case, but that how the
things seems to me now.