public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/36901]  New: pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors
@ 2008-07-22 16:15 manu at gcc dot gnu dot org
  2008-07-22 16:31 ` [Bug other/36901] " manu at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-07-22 16:15 UTC (permalink / raw)
  To: gcc-bugs

>From PR35637 but this is a general issue of the diagnostic machinery.

The problem is: -pedantic no warning, -pedantic-errors gives an
error. 

Explanation: The pedantic warning is in a system header, so it doesn't get
emitted. When using -pedantic-errors, it is an error, and errors are always
emitted.

Longer explanation: The problem is in
diagnostics.c (diagnostic_report_diagnostic) which checks only for DK_WARNING
if 
they should be inhibited (either because of -w or because location is within
system headers. However, pedwarn() is passing a DK_ERROR when -pedantic-errors
is enabled. 

One possible fix is that pedwarn() always passes a DK_WARNING type, while
-pedantic-errors reclassifies -pedantic warnings to emit errors. In other
words, -pedantic-errors would behave internally like -Werror=pedantic.


-- 
           Summary: pedwarn() + -pedantic-errors + -w (inhibit_warnings)
                    should not emit errors
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: manu at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-08-10 18:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-22 16:15 [Bug other/36901] New: pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors manu at gcc dot gnu dot org
2008-07-22 16:31 ` [Bug other/36901] " manu at gcc dot gnu dot org
2008-07-22 17:30 ` paolo dot carlini at oracle dot com
2008-07-22 18:08 ` manu at gcc dot gnu dot org
2008-08-09  0:00 ` manu at gcc dot gnu dot org
2008-08-09  0:00 ` manu at gcc dot gnu dot org
2008-08-09 17:17 ` eric dot weddington at atmel dot com
2008-08-09 17:17 ` eric dot weddington at atmel dot com
2008-08-09 17:32 ` manu at gcc dot gnu dot org
2008-08-09 19:36 ` eric dot weddington at atmel dot com
2008-08-09 20:40 ` manu at gcc dot gnu dot org
2008-08-10  3:14 ` eric dot weddington at atmel dot com
2008-08-10 14:50 ` manu at gcc dot gnu dot org
2008-08-10 16:51 ` eric dot weddington at atmel dot com
2008-08-10 18:35 ` manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).