It's probably worth noting that
y = x + 1
will flake out if x is an int, and it's value is INT_MAX. y = x + 1
will flake out if x is an int, and it's value is INT_MAX.That's not true in a theoretical sense (undefined behavior allows me to rewrite signed overflow to "return 7 with some probability, and `rm ~/` otherwise"), but for any modern compiler, I'd assume that the optimizations chosen where signed overflow is undefined don't involve randomness.
That line will always act consistently, modulo solar radiation.