GCC options to enforce Ansi C standard check?

c, c99, gcc

Solution

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.

Problem

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?

Original source