This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/2677: Need something to #ifdef on when -pedantic/-pedantic-errors
On Sat, Apr 28, 2001 at 01:27:03PM -0700, Ronald F. Guilmette wrote:
>
> The notion of ``system headers'' comes from the C standard itself and it
> refers to header files that are part and parcel of the LANGUAGE IMPLEMENTA-
> TION. The ANSI C standard allows such files to contain any arbitrary
> gibberish whatsoever (and in fact, they may not exist at all) as long as
> they APPEAR to exist and as long as they APPEAR to export the required
> macros and functions and as long as whatever they do contain (if they
> do in fact exist as separately identifiable text files at all) does not
> cause the compiler to choke.
>
> Header files which are parts of third-party packages clearly do not qualify
> as being a part of the LANGUAGE IMPLEMENTATION, and they SHOULD NOT be
> confused with such.
In point of fact, GCC considers any header found in /usr/include or
other specially designated place (at configuration time, or with
-isystem) as a "system header." GCC's idea of a "system header" does
not match that found in the C standard. It means only that all
warnings (except those triggered by #warning) are suppressed.
Whether or not this is the ideal behavior, I have no opinion. I will
point out, however, that a casual user of GCC likely does not have
write access to /usr/include, so any warnings evoked by any header in
there are equally irritating and equally unavoidable.
Independently of this, I think that a __PEDANTIC__ predefine would be
a good idea. It's easy to add - just another chunk of line noise in
gcc.c - and would be at least as useful as some of the predefines we
already have.
zw