Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compiling with c89 and c99 does gcc 4.4.2 default to c99?

Tags:

c

c99

c89

I am using gcc 4.4.2 on linux

I am just wondering does gcc automatically default to compiling with c99 as its the latest standard?

How can I specify if I want to compile with c89 or c99?

Many thanks for any advice,

like image 895
ant2009 Avatar asked Jan 23 '10 07:01

ant2009


1 Answers

One reason not to use C99 by default is because this standard is not fully implemented in the compiler yet. However, I believe that you can set the default mode when compiling gcc, so if the choice of standards really matters for you, it's better always to pass the option.

The options are -std=c99 and -std=c89 respectively.

like image 135
Pascal Cuoq Avatar answered Sep 28 '22 00:09

Pascal Cuoq