Messages in this thread | | | Subject | Re: 0xdeadbeef vs 0xdeadbeefL | From | Alexandre Oliva <> | Date | 07 Jul 2004 02:55:01 -0300 |
| |
On Jul 6, 2004, Ray Lee <ray-lk@madrabbit.org> wrote:
> Which means 0xdeadbeef is a perfectly valid literal for an unsigned int.
Assuming ints are 32-bits wide. They don't have to be. They could be as narrow as 16 bits, in which case the constant will have type long or unsigned long (because long must be at least 32 bits), or they could be wider than 32 bits, in which case the constant will be signed int instead of unsigned int. You might lose either way. It's probably safer to make it explicitly UL, except perhaps in machine-specific files where the width of types is well-known.
-- Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org} - 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/
| |