3 ms·
What do you define as "bad"? Arguably several. I've seen cases of overflow checks that were implemented assuming signed overflow (which all relevant platforms
by anarazel 5y ago
What do you define as "bad"?
Arguably several.
I've seen cases of overflow checks that were implemented assuming signed overflow (which all relevant platforms implement!) getting optimized away. Correct, given "signed overflow is UB" and thus can be assumed to not happen. Problematic given for widespread such checks are, and given that there's no easy portable alternative.
Entire checks getting optimized away because of a presumed strict aliasing violation. IIRC between structure with a compatible layout. Pretty code, no. UB yes. Reasonable, IDK.