Re: Problems shifting an int 32 times. Gcc 3.4.5

2006-10-24 Thread Paul Brook
> I have a problem using the shift operator, maybe a bug (ok, a bug or i'm > wrong about shift operator) You are wrong about the shift operator. This is a bug in your code, not a gcc bug. Shift operators are only defined for non-negative shifts counts less than the size of the value being shifte

Problems shifting an int 32 times. Gcc 3.4.5

2006-10-24 Thread Juan Reina
Hello: I have a problem using the shift operator, maybe a bug (ok, a bug or i'm wrong about shift operator) System: i386-redhat-linux Version: Gcc 3.4.5 Case: In the next snipplet: unsigned int getMask(int n){ unsigned int mask = 0; a = ~(~(a)