Re: Q: void* vs. unsigned long
H. Peter Anvin (hpa@transmeta.com)
16 Feb 1999 07:28:25 GMT
Followup to: <XFMail.990215231913.jeremy@goop.org>
By author: Jeremy Fitzhardinge <jeremy@goop.org>
In newsgroup: linux.dev.kernel
>
>
> On 16-Feb-99 Brian Gerst wrote:
> > I thought it was int that changed with the word size of the
> > architecture, not long. Most C books I've seen said long is always 32
> > bits regardless of the word size.
>
> Throw them away.
>
> long is defined to be the longest integer type, long enough to hold any other
> integer value (which is why "long long" is inherently broken). Casting between
> void * and long is never portable, but a compiler implementer would be a fool
> to break it.
>
"long" *was* defined to be the longest integer type. Not anymore.
Get over it.
-hpa
--
"Linux is a very complete and sophisticated operating system. There
are, and will be, large numbers of applications available for it."
-- Paul Maritz, Group Vice President for Platforms And Applications,
Microsoft Corporation [Reference at: http://www.kernel.org/~hpa/ms.html]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/