2 ms·
To clarify, it's not actually undefined behavior per se that I'm complaining about, it's the modern trend of highly optimizing compilers which take undefined be
by iainmerrick 9y ago
To clarify, it's not actually undefined behavior per se that I'm complaining about, it's the modern trend of highly optimizing compilers which take undefined behavior as an excuse to do all sorts of ridiculous things to your code.
"You may have thought you were checking for overflow here, but technically speaking the result of that operation could be undefined, therefore this code could do literally anything, or nothing. So I'll just remove it all. Congratulations, now it runs faster!"
I honestly hadn't realized that was a controversial view. Doesn't almost everyone dislike that? Are there a lot of C programmers who are happy to accept that risk in exchange for slightly better optimization?