As described by Linus here:
http://lkml.indiana.edu/hypermail/linux/kernel/0611.3/1020.html

Wshadow warns whenever any declaration shadows a global function
declaration. This is almost always noise, since most (always?) of the
time one cannot mistakenly replace a function by another variable. The
false positives are too common (Linus mentions using the name 'index'
when including string.h).

Interestingly, the C++ FE does not warn for this case, but it is not
very clear to me where this decision is taken.

Bootstrapped and tested.

OK?

2012-04-22  Manuel López-Ibáñez  <m...@gcc.gnu.org>

        PR c/53066
gcc/
        * c-decl.c (warn_if_shadowing): Do not warn for shadowed function
        declarations.
testsuite/
        * c-c++-common/wshadow.c: New.

Attachment: wshadow.diff
Description: Binary data

Reply via email to