未声明bool __builtin_sadd_overflow(int a,int b,int * res)

时间:2014-11-28 19:16:22

标签: gcc built-in

我在gcc手册中找到了“整数溢出内置函数”,但编译器不知道

'__builtin_sadd_overflow' was not declared in this scope

使用

调用
int x=0x7fffffff;
__builtin_sadd_overflow(2,x, &x);

编译器版本是

gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
在i686上

以下是手册:https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html

1 个答案:

答案 0 :(得分:2)

https://gcc.gnu.org/onlinedocs/gcc-4.8.3/gcc/C-Extensions.html(4.8.3版本的文档)没有提到溢出内置函数。未版本化的地址https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html对应于gcc(未来的gcc-5)的开发版本的文档。您可以等到3月或4月,或者开始播放快照,或使用clang's equivalent

相关问题