This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c/2677: Need something to #ifdef on when -pedantic/-pedantic-errors


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]