The C99 spec states:
The result of E1 >> E2 is E1 right-shifted E2 bit positions. If E1 has an unsigned type or if E1 has a signed type and a nonnegative value, the value of the result is the integral part of the quotient of E1 / 2^E2. If E1 has a signed type and a negative value, the resulting value is implementation-defined.
I'm curious to know, which implementations/compilers will not treat a signed E1 >> 31 as a bunch of 11111....?
1as the result. The standard is in fact carefully worded to avoid specifying whether>>performs an arithmetic shift or a logical shift.