Signed integer arithmetic uses integer representations that can denote negative and non-negative values. In two’s-complement representation, the same bit operation used for unsigned negation applies, but a high-order bit is interpreted as negative. section 5.7.5
A deceptively similar loop
for (unsigned i = 1; i; ++i) do_something(); for (signed i = 1; i; ++i) do_something(); The unsigned counter eventually wraps to zero. The signed counter can overflow instead; signed overflow has undefined behavior, so the compiler may assume it never occurs and optimize the second loop into an infinite loop. section 5.7.5
TAKEAWAY
- Treat signed overflow as undefined behavior, not as predictable wraparound. section 5.7.5
- Do not infer post-overflow execution: once execution reaches an undefined state, later behavior has no guaranteed continuation. section 5.7.5

