首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用c89和c99编译,gcc 4.4.2是否默认使用c99?

用c89和c99编译,gcc 4.4.2是否默认使用c99?
EN

Stack Overflow用户
提问于 2010-01-23 15:50:01
回答 2查看 8.9K关注 0票数 6

我在linux上使用的是gcc 4.4.2

我想知道的是,gcc是否自动默认使用c99作为其最新标准进行编译?

如何指定是使用c89编译还是使用c99编译?

非常感谢你的建议,

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-01-23 15:53:08

默认情况下不使用C99的一个原因是该标准在编译器中还没有完全实现。但是,我相信你可以在编译gcc时设置默认模式,所以如果标准的选择对你来说真的很重要,最好总是通过这个选项。

选项分别为-std=c99-std=c89

票数 10
EN

Stack Overflow用户

发布于 2010-01-23 15:53:54

gcc(1)手册页:

代码语言:javascript
复制
   -std=
       Determine the language standard.   This option is currently only
       supported when compiling C or C++.

....

       c99
       c9x
       iso9899:1999
       iso9899:199x
           ISO C99.  Note that this standard is not yet fully supported;
           see <http://gcc.gnu.org/gcc-4.4/c99status.html> for more
           information.  The names c9x and iso9899:199x are deprecated.

       gnu89
           GNU dialect of ISO C90 (including some C99 features). This is
           the default for C code.

       gnu99
       gnu9x
           GNU dialect of ISO C99.  When ISO C99 is fully implemented in
           GCC, this will become the default.  The name gnu9x is
           deprecated.
票数 9
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2122527

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档