Warnings in the C++ Front-End and GCC in General

Mark Mitchell mark@markmitchell.com
Wed Sep 9 05:52:00 GMT 1998


>>>>> "Joern" == Joern Rennecke <amylaar@cygnus.co.uk> writes:

    >> First of all, thank you very much, Mark! I really like the idea
    >> of turning warnings on and off from inside the source files;
    >> and I agree, using #pragma is the way to go!

    Joern> When this principle is applied to system include files,
    Joern> this could well lead to a fixunclude orgy.  We should keep
    Joern> in mind that there is a point where it is better to simply
    Joern> supress some warnings in system header files, rather than
    Joern> trying to add gcc-specific #pragmas to every header file.

Right.  I agree that, for the most part, warning from "system headers"
are not useful to users.  System header files are only one source of
pesky warnings, though.  Lots of other headers are not part of the
"system", and are not processed by fixincludes.

Your point, I think, is that this feature should not be overused.
Jeff, IIRC, made a similar point: that many warnings indicate real
problems, and that either the code in question, or the warning should
be fixed.  You'll get no argument from me!  But, there are cases where
the code cannot be fixed, and there are cases where well-designed
warnings will occasionally complain "spuriously".

Like most (all?) features, the ability to selctively turn off warnings
can be misused and overused.  Although your response was very mild,
I'm quite surprised at the vehemence some have expressed in opposition
to this proposed feature; we already have -w (for turning off warnings
completely) and -Wno-x for lots of choices `x'.  My proposal would
simply make this scheme more flexible, more automatic, and,
conceivably, extensible in a variety of ways.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com



More information about the Gcc mailing list