This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 18/348] Fix -Wsahdow warnings
> Date: Thu, 24 Nov 2011 10:16:14 +0600
> From: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: gdb-patches <gdb-patches@sourceware.org>
>
> > It seems a lot of the changes posted up until now are dealing with
> > that type of "conflict". ?I'd really like to see those dropped from
> > this set.
> >
>
> It is not a "conflict". It is a conflict.
I'm with Andrey on this one. Catching variables that clash with
well-known global identifiers, such as library functions, are about
the only good reason for using -Wsahdow; all the other kinds of
"shadowing" it flags are usually perfectly correct usage of C.
(I was actually bitten once by a mysterious bug caused by a variable
whose name was identical to an external symbol that came from a
library. I don't wish anybody to get into such a conundrum.)