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

Ian Kumlien pomac at vapor.com
Wed Oct 5 18:55:13 EDT 2005


On Wed, 2005-10-05 at 23:29 +0100, Tim Angus wrote:
> On Thu, 06 Oct 2005 00:09:03 +0200 Ian wrote:
> > > I don't know what makes you think setting a function pointer to 0 is
> > > C++, perhaps the syntax for declaring a pure virtual? The compiler
> > > that produces the warnings is (q3)lcc, which builds the vm files.
> > 
> > C has it defined as NULL, while C++ started using 0. But ok if the vm
> > compiler is the one then i get it.
> 
> C has what defined as NULL? NULL is defined as either 0 or (void *)0
> depending on the system, but in practice they're equivalent. When a C
> compiler sees a pointer of any type set to 0, it effectively casts the 0
> to a type appropriate for the pointer, so it could be argued that 0 is
> "better" than (void *)0 which is an explicit cast. It really doesn't
> matter though since dereferencing either value is an error.

In C you do NULL, since NULL could be defined in several ways.
Apparently compilers these days workaround such things if you just put 0
there. All i said was that 0 is a C++:ism, which it is.
(and it's not like a cast takes time in c)

> Yes and yes. This all seems like a rather pointless quibble to be honest
> -- it's a non-issue.

A random adress in the variable is much worse since it could
theoretically execute code that shouldn't be run and take time to debug.

> > Nope... I still get it with rev 144.
> 
> Yes, it is. make distclean or checkout a clean copy and try again.

ok, make clean didn't seem to do the trick.

-- 
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/20051006/a60802c4/attachment.pgp>


More information about the quake3 mailing list