NULL vs 0 vs 0L bikeshed time

Bruce Evans bde at zeta.org.au
Mon Mar 1 21:47:01 PST 2004


On Mon, 1 Mar 2004, Erik Trulsson wrote:

> On a related note, is there some particular reason for having the C++
> definition depend on __LP64__ or could one not just as well define NULL
> as (0L) all the time there?

Mainly the same reason that 0 was only changed to (void *)0 (sic) for
the _KERNEL_ case only, but more so: the type sizes may be different
so sloppy but working code may break.

> (I.e. is there any platform FreeBSD runs on that have 32-bit longs and
> 64-bit pointers, or does all of them have pointers and long being the
> same size?)

Someone mentioned that i386's can have 64-bit longs (IP32L64).  I had
this booting and running most utilities, but it couldn't quite build
itself and I haven't run it for a year or two.

Bruce


More information about the freebsd-current mailing list