如何找出默认情况下我的gcc使用哪种ANSI C标准? [英] How to find out which ANSI C standard my gcc works with by default?

查看:154
本文介绍了如何找出默认情况下我的gcc使用哪种ANSI C标准?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读这里它是带扩展名的C90。我怎么知道这个问题?

使用 -std = 标志来指定一种语言方言: c89 c99 c ++ 98 等。请注意, c90 相当于 c89



在C模式下, -ansi 会导致 -std = c89 ,并且 -std = c ++ 98



使用 -pedantic 启用标准要求的所有诊断。

对于C和 gnu89 > gnu ++ 98 用于C ++。请参阅手册以了解各种方言的详细说明。


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

解决方案

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.

这篇关于如何找出默认情况下我的gcc使用哪种ANSI C标准?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆