Steve French <smfrench@austin.rr.com> writes:
> look wrong for gcc to spit out warnings on. For example the following
> local variable definition and the similar ones in the same file
> (fs/cifs/inode.c):
>
> __u64 uid = 0xFFFFFFFFFFFFFFFF;
>
> generates a warning saying the value is too long for a long on x86
> SuSE 8.2 with gcc 3.3 - which makes no sense. Any value
> above 0xFFFFFFFFF generates the same warning (intuitively
> 36 bits should fit in an unsigned 64 bit local variable).
>
> Defining the literal with the UL suffix didn't seem to help - and I
Define it with ULL (= long long)
> Any idea what is going on in this weird gcc 3.3 behavior where it thinks
> 64 bits can't fit in a __u64 local variable? -
AFAIK the problem is that it has no default promotion for constants to
long long (normally they are int, long, unsigned long etc. depending on
their value) It's some C99 thing. Or maybe a gcc bug. Anyways ULL
makes it clear that it is unsigned long long.
-Andi
P.S.: The warning is thankfully turned off by default again in later
compilers.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:27 EST