Expand the definition of gnu89 slightly

Joseph S. Myers jsm28@cam.ac.uk
Tue Feb 4 23:21:00 GMT 2003


On Tue, 4 Feb 2003, Neil Booth wrote:

> I wonder what others think about making GCC warn or error about more
> constructs that are disallowed in the relevant language standard (i.e.
> non-GNU).

You mean enabling -pedantic (or -pedantic-errors) by default with -ansi /
-std=c89 / -std=c99 (while keeping the separate -pedantic option to be
used with gnu89 the way GCC uses it: warn about non-standard features
without the awkward side effects of -ansi on headers)?  That seems
reasonable.  (And means the correct patch in this case is still one that
tests pedantic.  flag_iso should rarely be used.)  Unless you mandate
-pedantic in the strict standards modes you also need -no-pedantic to
disable it and to add -no-pedantic to the testcases testing assertions
that certain features should work given just the standard option without
-pedantic.

Changing the strict modes like that is reasonably compatible with the GNU
practice of accepting lots of extensions by default.  (And -Wall by
default is also compatible with GNU having lots of features by default -
as long as people can turn it off with -Wno-all.)  Changing gnu89 so it
isn't more or less "the GNU C language, following C90 rather than C99
where the same code is meaningful in both but with different meanings"
would be more of a problem.  GNU C is a language with lots of features and
extensions, but differences between the two dialects minimised to where
the standards differ about the same code or where gnu89 needs to have
different semantics for something for compatibility (e.g. compound
literals; inline (when C99 semantics are implmented)).

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-patches mailing list