Re:A bit of background on compilers exploiting signed overflow
by jmgao on Sunday May 08, 2016 @06:24PM
(#11656277)
> In this case, our conventional languages provide no way for a programmer to say "I care about overflow".
GCC and clang have builtin operations that return whether they overflowed (bool __builtin_add_overflow(T a, T b, T* out), etc.). Similarly, Rust has wrapping, checked and saturating versions of all of the operations as methods on the integer types.
GCC and clang have builtin operations that return whether they overflowed (bool __builtin_add_overflow(T a, T b, T* out), etc.). Similarly, Rust has wrapping, checked and saturating versions of all of the operations as methods on the integer types.