为什么gcc会长时间发出警告?

时间:2016-07-21 15:11:45

标签: c++ c gcc types gcc-warning

-Wlong-long gcc警告的原因是什么?

来自gcc手册页:

-Wlong-long
       Warn if long long type is used.  This is enabled by either -Wpedantic or -Wtraditional in ISO C90 and C++98 modes.  To inhibit the warning messages, use -Wno-long-long.

据我了解,long long必须至少为64位(实际上它总是64位,至少对于今天的编译器而言)。这不是ISO C90或C ++ 98的情况,还是有其他原因不使用long long

我知道<stdint.h>类型int64_t和朋友,但是一些不太旧的编译器(例如VS2005和Green Hills ARM 3.5)不提供<stdint.h>,而我对于那些和更新的工具链,long long(至少)是64位。

1 个答案:

答案 0 :(得分:37)

ISO C90和C ++ 98中还没有long long类型。它仅在ISO C99和C ++ 11中添加。

GCC在标准化之前将其作为扩展提供了。

相关问题