Re: Recent change in tcp_output.c is surely wrong

From: Jesse Pollard (pollard@tomcat.admin.navo.hpc.mil)
Date: Wed Jan 19 2000 - 08:56:31 EST


Richard B. Johnson" <root@chaos.analogic.com>:
....
>int main()
>{
> int xxx = 1;
>
> printf("%08x (%d)\n", xxx, xxx);
> xxx <<= 31;
> printf("%08x (%d)\n", xxx, xxx);
> xxx >>= 31;
> printf("%08x (%d)\n", xxx, xxx);
> return 0;
>}
># gcc -O2 -o xxx xxx.c
#> ./xxx
>00000001 (1)
>80000000 (-2147483648)
>ffffffff (-1)
># exit

Is true for signed integers. Unsigned integers do get a logical shift:
00000001 (1)
80000000 (-2147483648)
00000001 (1)

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:20 EST