When's the last time you worked with an architecture that didn't use twos complement and roll into negatives on overflow?
Your reserved bottom range is a perfectly good solution. But rolling into negatives seems fine, too.
Your reserved bottom range is a perfectly good solution. But rolling into negatives seems fine, too.
[1]https://stackoverflow.com/questions/18195715/why-is-unsigned...
The -fstrict-overflow option is enabled at levels -O2, -O3, -Os.
In other words, basically every program that you're using is compiled with that option enabled. (Release builds typically use -O2, sometimes even -O3.)They do it, so they can simplify things like "x < x+1" to "true".
for (int x = 0; x >= 0; x++)
making it an infinite loop, because it assumes "x++" can't overflow.