Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C99 not default C- version for GCC?

Tags:

c

gcc

c99

Why does not GCC compile the C99 by default? I mean why is it necessary to add --std=c99 flag everytime a code in C99 is written?

like image 570
smilingbuddha Avatar asked Feb 20 '11 23:02

smilingbuddha


1 Answers

Edit: As of GCC 5, -std=gnu11 is the default. See Porting to GCC 5.


See C Dialect Options, gnu89 is the default.

`gnu89'

GNU dialect of ISO C90 (including some C99 features). This is the default for C code.

As @tsv mentioned, ISO C99 is not fully supported yet:

`c99'
`c9x'
`iso9899:1999'
`iso9899:199x'

ISO C99. Note that this standard is not yet fully supported; see http://gcc.gnu.org/c99status.html for more information. The names `c9x' and `iso9899:199x' are deprecated.

And also:

`gnu99'
`gnu9x'

GNU dialect of ISO C99. When ISO C99 is fully implemented in GCC, this will become the default. The name `gnu9x' is deprecated.

like image 189
Gregory Pakosz Avatar answered Sep 27 '22 19:09

Gregory Pakosz