3 ms·
Yes, it'll exploit the fact that signed overflow is undefined. int incr(int i) { int old = i; i += 1; if (i < old) return 1; return
by vinkelhake 13y ago
Yes, it'll exploit the fact that signed overflow is undefined.
int incr(int i) {
int old = i;
i += 1;
if (i < old) return 1;
return 0;
}
GCC optimizes this to 'return 0;'.
EDIT: Updated to a better example.