我想知道是否有等效于 int64_t
在 C 中可以在 32 位和 64 位平台上运行,并且符合 ansi 和 pedantic gcc 模式。
我发现这很有趣 post ,但它与 C++ 相关。
我试过用 long long
但我得到一个 integer overflow in expression [-WOverflow]
错误。此外long long
ISO C90 不支持。
我也尝试了这个 post 中的建议,但我还有一个 -WOverflow
使用 int64_t
时出错
任何解决方案?
最佳答案
-ansi
标志要求),没有使用 64 位整数的标准方法。您必须依赖您的实现提供的类型。 int64_t
,因为它是一个可选类型。至于long long
(C99),不能保证它的宽度正好是 64 位。 关于c - -ansi -pedantic C 中的 64 位长度整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16101002/