lkml.org 
[lkml]   [2004]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: 0xdeadbeef vs 0xdeadbeefL
From
Date
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/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.337 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site