This is the mail archive of the
mailing list for the GCC project.
Re: PR c/53066 Wshadow should not warn for shadowing an extern function
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jason Merrill <jason at redhat dot com>
- Date: Sun, 22 Apr 2012 12:31:24 -0500
- Subject: Re: PR c/53066 Wshadow should not warn for shadowing an extern function
- References: <CAESRpQDQcYaLn4Dp0PJeH5sC9vT5AMrzJFv6WJLsd5UAe8J6tw@mail.gmail.com>
On Sun, Apr 22, 2012 at 11:00 AM, Manuel López-Ibáñez
> As described by Linus here:
> Interestingly, the C++ FE does not warn for this case, but it is not
> very clear to me where this decision is taken.
C++'s type system does not make it very likely to get into the
troubles that -Wshadow was attempting to warn about (shadowing
on extern function by a local variable) -- thanks god.
This particular behaviour of-Wshadow is entirely up to C folks to
have or not. I would suspect that it is not as useful in C99 or C11
as it might be in C K&R or even C90.