c/2291: Pedantic may be too pedantic
Joseph S. Myers
jsm28@cam.ac.uk
Thu Mar 15 02:18:00 GMT 2001
On 15 Mar 2001 lw@atod.se wrote:
> It would be nice if the compiler invoked with the pedantic flag in
> combination with dialect specifier would warn only when using
> constructs that is not in the dialect definition or another way of
> checking the code against dialect definition of choice.
By definition, gnu89 includes all extensions which the compiler accepts in
gnu89 mode, so with that model of -pedantic there wouldn't be anything to
check: either a feature is part of gnu89 (and so wouldn't be warned about
with -pedantic) or isn't (and so would yield an error even without
-pedantic). Instead, -pedantic warns about constraint violations from the
underlying standard definition (c89 for -std=gnu89). This is useful
behavior; GCC itself uses it when bootstrapping.
The manual doesn't really document the precise meaning of -pedantic well
enough (though it can only make proper sense if you're familiar with the
formal requirements of the language standards for diagnostics in certain
cases). I'll see if I can improve the documentation in this area.
--
Joseph S. Myers
jsm28@cam.ac.uk
More information about the Gcc-bugs
mailing list