If the value after the shift operator is greater than the number of bits in the left-hand operand, the result is undefined. If the left-hand operand is
If the value after the shift operator is greater than the number of bits in the left-hand operand, the result is undefined.
It means (unsigned int)x >> 33 can do anything[1].
If the left-hand operand is unsigned, the right shift is a logical shift so the upper bits will be filled with zeros.
It means 0xFFFFFFFFu >> 4 must be 0x0FFFFFFFu
If the left-hand operand is signed, the right shift may or may not be a logical shift (that is, the behavior is undefined).
It means 0xFFFFFFFF >> 4 can be 0xFFFFFFFF (arithmetic shift) or 0x0FFFFFFF (logical shift) or anything-allowed-by-physical-law, i.e. the result is undefined.
[1]: on 32-bit machine with a 32-bit int.