Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCC options to enforce Ansi C standard check?

Tags:

c

gcc

c99

What gcc options shall I use to enforce ANSI C (C99) warnings/errors? gcc (GCC) 3.4.2 (mingw-special)

I'm using: gcc -pedantic -ansi -std=c99 is this correct?

like image 321
AlfaTeK Avatar asked Nov 30 '09 19:11

AlfaTeK


1 Answers

The -ansi flag is synonymous with the -std=c89 flag.

Just using -std=c99 with -pedantic should be sufficient.

When in doubt, you can always refer to the GCC documentation. As of GCC 3.4.2, the chapter to read is 2 - Language Standards Supported by GCC.

like image 181
James McNellis Avatar answered Oct 10 '22 22:10

James McNellis