Re: Problems (a bug?) with UINT_MAX from kernel.h

2007-06-05 Thread H. Peter Anvin
Richard Purdie wrote: > The kernel uses UINT_MAX defined from kernel.h in a variety of places. > > While looking at the behaviour of the LZO code, I noticed it seemed to > think an int was 8 bytes large on my 32 bit i386 machine. It isn't but > why did it think that? > > kernel.h says: > > #defi

Re: Problems (a bug?) with UINT_MAX from kernel.h

2007-06-05 Thread Andreas Schwab
Richard Purdie <[EMAIL PROTECTED]> writes: > If I try to compile the code fragment below, I see the error: > > #define UINT_MAX (~0U) > #if (0x == UINT_MAX) > #error argh > #endif The preprocessor computes all expressions with the largest available range. It does not know

Re: Problems (a bug?) with UINT_MAX from kernel.h

2007-06-05 Thread John Anthony Kazos Jr.
> The kernel uses UINT_MAX defined from kernel.h in a variety of places. > > While looking at the behaviour of the LZO code, I noticed it seemed to > think an int was 8 bytes large on my 32 bit i386 machine. It isn't but > why did it think that? > > kernel.h says: > > #define INT_MAX

Problems (a bug?) with UINT_MAX from kernel.h

2007-06-05 Thread Richard Purdie
The kernel uses UINT_MAX defined from kernel.h in a variety of places. While looking at the behaviour of the LZO code, I noticed it seemed to think an int was 8 bytes large on my 32 bit i386 machine. It isn't but why did it think that? kernel.h says: #define INT_MAX ((int)(~0U>>1)) #defi