Here's a gotcha I find more interesting than strlen: Right shifting integers instead of dividing by powers of two, e.g:
1337 / 8;
Becomes:
1337 >> 3;
Compilers ought to figure that one out, shouldn't they? Well if 1337 is a signed int, they can't. Shifting actually leads to different semantics for negative numbers, so this optimisation is only possible for unsigned ints. You can either do the bit shift or cast to unsigned, but it's a leaky abstraction either way.