Paul Baltescu Paul Baltescu - 8 months ago 64
C Question

How to enable c11 on later versions of gcc?

I currently use

gcc 4.6.3
. My understanding is that
by default uses the
standard and I would like to enable C11, the latest C standard. I tried:

[pauldb@pauldb-laptop test ]$ gcc -std=c11 -o test test.c
cc1: error: unrecognised command line option ‘-std=c11’

I replaced
and I get the same error. What is the correct way to enable the latest C standard for gcc?

(Note: I'm interested in the latest C standard and not the latest C++ one.)


-std=c11 is the correct option but is not available in gcc 4.6.

You need at least gcc 4.7 to have this option supported. In some older versions like gcc 4.6, the option -std=c1x was available with experimental (i.e., very limited) support of C11.

Also note that the current version of gcc is gcc 4.8.0.