Shift at your own peril. Per the standard, what you want to do is undefined behavior.
C99 §6.5.7
3 - The integer promotions are performed on each of the operands. The type of the result is that of the promoted left operand. If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined.
In other words, if you try to shift a 32bit value by anything more than 31 bits, or a negative number, you're results are undefined.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…