On Fri, Nov 03, 2006 at 06:09:39PM +0100, Mikulas Patocka wrote:,--In gmane.linux.kernel, you wrote:
[]
From: Andrew Morton <akpm@xxxxxxxx>
As Mikulas points out, (1 << anything) won't be evaluating to zero.
How about integer overflow ?
C standard defines that shifts by more bits than size of a type are
undefined (in fact 1<<32 produces 1 on i386, because processor uses only 5
bits of a count).
|#include <stdio.h>
|int main(void) {
| unsigned int b = 1;
|
| printf("%u\n", (1 << 33));
| printf("%u\n", (b << 33));
| return 0;
|}
|$ gcc bit.c && ./a.out
`--
There *is* difference, isn't it?