What is the default C -std standard version for the current GCC (especially on Ubuntu)?

后端 未结 6 1213
鱼传尺愫
鱼传尺愫 2020-11-27 13:23

When I ask to see the current version of cc I get this.

$ cc --version
cc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, I         


        
6条回答
  •  暖寄归人
    2020-11-27 14:16

    The first line will give your GCC version (4.7.2)

    (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2

    When you compile your code, you can specify which C/C++ revision you want to use, by adding -std=c99 or -std=c99 ...

    Note gnu89 is used by default.

提交回复
热议问题