[cfe-dev] RFC: switch default C language mode from gnu99 to gnu11

David Chisnall David.Chisnall at cl.cam.ac.uk
Thu Oct 16 03:16:44 PDT 2014


On 15 Oct 2014, at 23:22, Richard Smith <richard at metafoo.co.uk> wrote:

> I'd like to switch the default language mode for C compilations from gnu99 to gnu11. The only effect of this change would be to turn some extension warnings off, change the default value of __STDC_VERSION__, and change the default value of some __has_feature(...) checks; we allow all of C11 as an extension in C99 mode anyway.
> 
> Also of note: GCC trunk just switched from C89 to C11 by default.

The only reason GCC took so long to switch from gnu89 was that the inline keyword changed meanings between gnu89 and gnu99. As I understand it, all gnu99 code is also valid gnu11 code, so this shouldn't be a problem.

It would be nice to have a warning that objects if you use any reserved identifiers (double underscore, underscore-capital) outside of a system header / system library so that people can ensure that their c11 code will be valid for whatever the next iteration of the standard is.

David





More information about the cfe-dev mailing list