>>/<< 32 Bit wrong on 32 architechture

From: Gerhard Hintermayer (g.hintermayer_at_inode.at)
Date: 12/29/03


Date: 29 Dec 2003 05:40:35 -0800

I recently discovered that shifting left/right with 32 Bits leads to
wrong results :

expr 5>>32 is 5, expr 5<<32 is 5, where I'd expect a result of 0 in
both cases.
Interesting, that 5<<31 and 5>>31 do return the correct values.
For implementing shifts in a bitmask broader than 32 bit (in separate
32-bit variables) this behavior is not very helpful, ? :
subexpressions have to be inserted, when the shift amount is 32.

I tested this with 8.4.5 (tclkit only) and 8.4.1 under linux (i368
architecture)

Should I file a bug report ?

Gerhard