This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/36901] pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2008 18:07:53 -0000
- Subject: [Bug other/36901] pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors
- References: <bug-36901-13511@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from manu at gcc dot gnu dot org 2008-07-22 18:07 -------
(In reply to comment #2)
> Thanks a lot Manuel! Maybe I will even be able to come to this, thanks to your
> suggestions for a fix.
>
I think there is a problem with my suggestion: -pedantic-errors does not only
affect -pedantic warnings but it also affects pedwarns that are not controlled
by -pedantic. -Werror=pedantic would only affect those warnings controlled by
-pedantic, so it would not be equivalent to -pedantic-errors. :(
At the moment where diagnostic_report_diagnostic checks
diagnostic_report_warnings_p (location), the machinery does not know that this
is a pedwarn. I guess we could pass a special code DK_PEDWARN, and test for
flag_pedantic_errors within diagnostic_report_diagnostic so we can reclassify
it as DK_ERROR or DK_WARNING; or we could pass a special code DK_PEDERROR and
for that code also check diagnostic_report_warnings_p before reclassifying it
to DK_ERROR; or we could make a call to diagnostic_report_warnings_p (location)
directly in pedwarn before passing down a DK_ERROR.
Sorry I can't be more precise. This needs more time to think that I have
available.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36901