4 ms·
> C cannot read the overflow bit after an ADD ... The compiler should offer a macro for that. If you use GCC then __builtin_add_overflow() is what you are look
by jburgess777 8y ago
> C cannot read the overflow bit after an ADD ... The compiler should offer a macro for that.
If you use GCC then __builtin_add_overflow() is what you are looking for:
"The compiler will attempt to use hardware instructions to implement these built-in functions where possible, like conditional jump on overflow after addition, conditional jump on carry etc."
https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins...
- posterboy 8y agoYes, I know that. Y ou could add macros implementing a complete asm language to become a subset of C and C would still be more expressive