[quake3] Re: C++? when did that happen?

Ian Kumlien pomac at vapor.com
Fri Oct 7 22:29:38 EDT 2005


On Sat, 2005-10-08 at 03:45 +0200, Ludwig Nussel wrote:
> Tim Angus wrote:
> > [...]
> > I'll say again, using 0 in place of NULL in C is perfectly valid and
> > correct. Yes, NULL is implementation defined, but that DOES NOT make the
> > use of 0 in place of NULL wrong, nor does it make it a "C++ism".
> 
> You cannot blindly replace NULL with 0. sizeof(0) != sizeof(NULL) on
> 64bit platforms. Variadic functions for example will break if you pass 0 where
> you wanted to pass NULL. So always use NULL if you refer to a pointer.

I actually found some information that claimed more or less that:
pointer = 0 would be translated to pointer = 0 or pointer = (void *)0 as
needed... I looked for this more or less specifically since i also use a
64 bit platform. (I do however hope that it's 0L or (void *)0 since that
would handle the to small pointer issues that usually happens)

However this is for ID's own compiler so i don't see it as serious as a
common compiler (ie, if it makes a mistake the fix will be local not
global and it is also a C++ compiler which should have the smarts
mentioned above).

-- 
Ian Kumlien <pomac () vapor ! com> -- http://pomac.netswarm.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://icculus.org/pipermail/quake3/attachments/20051008/40878ece/attachment.pgp>


More information about the quake3 mailing list