This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Is it time to flip the switch to make -std=gnu99 the default?


On Mon, 17 Jun 2002, Kelley Cook wrote:

> I was wondering if any of you developers thought that it might be time to make
> -std=gnu99 the default for 3.2, instead of -std=gnu89?

I intend that change to be made when C99 support is genuinely complete.  
Until then, having C99 mode (with its corresponding definition of
__STDC_VERSION__) on by default will just break portable programs testing
for C99 with __STDC_VERSION__.

("Genuinely complete" does not just mean a checklist - it also means
passing all the C99 - and C90 - testcases, including those for subtle
points such as constant expression constraints we get wrong in both cases.  
It would also be strongly desirable for third-party testsuites to be
passed in their entirety (as has been done with C90 testsuites) before
claiming complete C99 implementation.)

A -Wc89 option - to give the warnings presently given by -std=gnu89
-pedantic, as is used in the GCC bootstrap to detect uses of C99 features
- is also needed so that a default gnu99 mode is usable for bootstrapping
for GCC without letting C99 features get in where they shouldn't.

(GCC should, however, bootstrap in gnu99 mode, albeit without those
warnings.  It is however a long time since I last tested that (as part of
the testing of some C99 changes).)

> 2) GCC used to, by default, have all its extensions supported.  It would seem to
> this outsider that those extensions should include support for any newly
> implemented C99 features without having to specify an extra commandline option.

Those features that are consistent with gnu89 mode are enabled, e.g.  
compound literals (with C99 semantics, but with some extensions used by
Linux enabled in gnu89 mode only), mixed declarations and code (which some
people have nevertheless complained about being enabled by default).  
Some aren't consistent with not being in C99 mode, e.g. declarations in
for loops (it would be bad for them to get a scope going beyond the loop,
and the C99 scope changes that give loops their own scopes are only
enabled in C99 mode).  C99 inline semantics (not yet implemented) would
break too much if enabled in gnu89 mode (the inline and __inline__
keywords will have the current GNU semantics in gnu89 mode, C99 semantics
in gnu99 mode).

-- 
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]