How to find out which ANSI C standard my gcc works with by default?

后端 未结 1 1127
谎友^
谎友^ 2020-12-19 07:03

I read here it is C90 with extensions. How can I know for sure?

相关标签:
1条回答
  • 2020-12-19 07:42

    Use the -std= flag to specify a language dialect: c89, c99, c++98, etc. Note that c90 is equivalent to c89.

    As a shorthand -ansi causes -std=c89 in C mode and -std=c++98 in C++ mode.

    Use -pedantic to enable all diagnostics that the standards require.

    The defaults are gnu89 for C and gnu++98 for C++. Consult the manual for detailed descriptions of the various dialects.

    0 讨论(0)
提交回复
热议问题