What is the difference between the following two lines:
signed int s = INT_MAX; unsigned int u = UINT_MAX; s++; // 1 u++; // 2
The former is undefined, while the latter is defined, see a pretty good SO discussion here on the matter
Turns out, this can sneak up on you, especailly when C's automatic type promotion starts to kick in coupled with the optimizer. In particular, aggresive optimization engines that can prove the result of a calculation is undefined will generally omit the operation completely (see gcc's -fstrict-overflow, which is turned on at -O2+).