Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Mar 2005 14:38:29 -0500
From:      Mike Edenfield <kutulu@kutulu.org>
To:        ports@freebsd.org, kde@FreeBSD.org
Cc:        Volker Stolz <vs@FreeBSD.org>
Subject:   Re: C++ issue on 4.11: kpopupmenu.h [Please review]
Message-ID:  <4230A235.9050703@kutulu.org>
In-Reply-To: <20050310192527.GC1911@zi025.glhnet.mhn.de>
References:  <20050310120140.GD80397@i2.informatik.rwth-aachen.de> <20050310192527.GC1911@zi025.glhnet.mhn.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Simon Barner wrote:

 > Volker Stolz wrote:
 > [...]
 >
 >> As far as I know, all systems with NULL != 0L have either been 
molten down
 >> or are otherwise not in a position to run KDE :)
 >
 >
 >
 > Volker,
 >
 > AFAIK, null pointers in C++ are supposed to be written as 0 (or OL for
 > (some?) 64 bit platforms).


In the context of a pointer (that is, wherever a pointer value is 
expected), the constant 0 *is* a null pointer, regardless of what actual 
  underlying value is stored for such pointers.  That is, (int)0 and 
(void *)0 do not have to be the same sequence of bits.  The NULL typedef 
is simply used to force the 0 constant to be a pointer by typecasting it 
to (void *), so the compiler can never confuse it with an integeral 
constant.

Or, to summary the answer to the OP's question:

For ALL systems that are standards compliant, NULL == (void *)0.  For 
most currently operating modern processors, (void *)0 is saved as a 
32-bits-zero or 64-bits-zero number.  However, those two statements are 
coincidentally, not causally, related.

--Mike



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4230A235.9050703>