Messages in this thread | | | Date | Wed, 7 Jul 2004 04:48:36 -0700 (PDT) | From | tom st denis <> | Subject | Re: Prohibited attachment type (was 0xdeadbeef) |
| |
--- "Richard B. Johnson" <root@chaos.analogic.com> wrote: > Tom is correct. A literal constant defaults to 'int'.
I did a bit more messing around with GCC and it seems in
int x = 4; if (x == 0xDEADBEEF) { ... }
It will warn that 0xDEADBEEF is unsigned (which it isn't). Either there is an obscure clause in the C standard [I personally don't have a copy of C99 nor do I plan on reading it for this] or GCC cause an incorrect diagnostic [which isn't in violation of the standards...]
Really GCC should just warn that 0xDEADBEEF is not a valid int constant [for portability sake...]. It's simple, any constant > 16-bits should have a UL/L or ULL/LL suffix.
Tom
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - 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/
| |