This is the mail archive of the gcc-bugs@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]

[Bug c/48062] `shadowed declaration is here' should be a note


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48062

--- Comment #3 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-06-09 07:55:37 UTC ---
(In reply to comment #2)
> Produces no warning. So for me it is a bit confusing, since the warning setting
> refers to pieces of code and not to variables.

You are right and it is a bug. The reason is that each warning message (the
second should be note) is produced by different calls to warning(). These calls
are conditional on Wshadow but the #pragmas only disable Wshadow for a certain
location. The fix is to make "shadowed declaration is here" a call to inform()
(that is, a note) conditional on the first warning being emitted, which one can
test by checking the return value of warning(). Patches welcome.


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