Re: C language lawyers needed

From: Al Viro
Date: Wed Aug 27 2008 - 18:17:25 EST


On Wed, Aug 27, 2008 at 03:00:01PM -0700, H. Peter Anvin wrote:
> Looks like a gcc bug to me.
>
> 0xff000000 is unsigned, like any hexadecimal constant.

Not any. Ones that do not fit into range of int but do fit into the range
of unsigned are.

Really, folks, it's not _that_ hard:

Type sequence: int, unsigned int, long, unsigned long, long long,
unsigned long long.
With U suffix => don't bother with signed types
Without U suffix, decimal => don't bother with _un_signed types
With L suffix => don't bother with anything earlier than long
With LL suffix => don't bother with anything earlier than long long
Pick the first type that covers your value; that will be it.

In particular, 0x[0-9A-Fa-f]+ == try *everything*.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/