How to find my current compiler's standard, like if it is C90, etc

前端 未结 5 1725
梦谈多话
梦谈多话 2020-12-13 09:29

I\'m working on a Linux machine. Is there any system command to find the standard followed by the C compiler I\'m using?

5条回答
  •  失恋的感觉
    2020-12-13 09:51

    You probably have gcc, in which case you can specify the standard at compile-time, e.g.

    $ gcc -Wall -std=c89 foo.c -o foo
    

    or:

    $ gcc -Wall -std=c99 foo.c -o foo
    

    Type:

    $ man gcc
    

    for full details.

提交回复
热议问题