This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/2677: Need something to #ifdef on when -pedantic/-pedantic-errors
- To: nobody at gcc dot gnu dot org
- Subject: Re: c/2677: Need something to #ifdef on when -pedantic/-pedantic-errors
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: 28 Apr 2001 20:56:00 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
The following reply was made to PR c/2677; it has been noted by GNATS.
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: "Ronald F. Guilmette" <rfg@monkeys.com>
Cc: <gcc-gnats@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>
Subject: Re: c/2677: Need something to #ifdef on when -pedantic/-pedantic-errors
Date: Sat, 28 Apr 2001 21:51:39 +0100 (BST)
On Sat, 28 Apr 2001, 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-
ISO 9899 does not contain the term. The GNU CPP manual defines how it is
used in a GCC context: to mean headers found in specific directories, and
those otherwise marked as system headers. The exclusion of warnings from
system headers is a pragmatic matter, since they aren't under the control
of the user and it reduces (in some cases) the amount of work fixincludes
needs to do.
> In fact, in an ideal world, virtually EVERY gcc/g++ compilation option
> (with the possible exception of the -W options) would be represented by
But -pedantic and -pedantic-errors are essentially -W options (whenever
they do not act solely as such, that is a bug)!
There is a defined mechanism for user code to avoid some -pedantic
warnings: use __extension__. If you are counting a library as part of
your application, and it does not meet your coding standards as to what
warnings should be avoided, you will (in general) need to adapt it to meet
your standards.
Some warnings may not be avoidable by __extension__. In future we hope to
provide pragmas for fine-grained exclusion of specific warnings from
specific lines of code (or from a whole translation unit); see the
projects list.
Some -pedantic warnings, for features now in C99, can also be avoided by
using -std=gnu99.
--
Joseph S. Myers
jsm28@cam.ac.uk