gpt4 book ai didi

c++ - -GCC4.8.1 的标准默认值

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:57:53 24 4
gpt4 key购买 nike

如果我在使用 GCC4.8.1 编译我的 C++ 应用程序时没有指定 -std 选项,它默认应用 c++11 值吗?

我读了 GCC 文档中的话,但仍然不确定。我的英语不好,所以这可能是我的问题。

-fext-numeric-literals (C++ and Objective-C++ only) Accept imaginary, fixed-point, or machine-defined literal number suffixes as GNU extensions. When this option is turned off these suffixes are treated as C++11 user-defined literal numeric suffixes. This is on by default for all pre-C++11 dialects and all GNU dialects: -std=c++98, -std=gnu++98, -std=gnu++11, -std=gnu++1y. This option is off by default for ISO C++11 onwards (-std=c++11, ...).

最佳答案

2018 年更新:在最新版本的 gcc 中,-std 的默认选项现在是 -std=gnu++14


来自 gcc standards 2.2 C++语言

The default, if no C++ language dialect options are given, is -std=gnu++98.

所以如果你想启用 C++11 功能,你必须添加选项 -std=c++11-std=gnu++11 (对于带有 GNU 扩展的 C++11)

关于c++ - -GCC4.8.1 的标准默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17940281/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com