Right shift and signed integer
On my compiler, the following pseudo code (values replaced with binary): sint32 word = (10000000 00000000 00000000 00000000); word >>= 16; produces a word with a bitfield that looks like this: (11111111 11111111 10000000 00000000) My question is, can I rely on this behaviour for all platforms and C++ compilers? Andrew Clark From the following link: INT34-C. Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand Noncompliant Code Example (Right Shift) The result of E1 >> E2 is E1 right-shifted E2 bit positions. If E1