首页 文章

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

提问于
浏览
31

-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 回答

  • 36

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

    然而,GCC在标准化之前将其作为扩展 .

相关问题