Subject: Re: pkg/15952: www/galeon-1.2.0 does not build with mozilla-0.9.9
To: NetBSD Bugs and PR posting List <netbsd-bugs@NetBSD.ORG>
From: Matthias Buelow <mkb@reiher.informatik.uni-wuerzburg.de>
List: netbsd-bugs
Date: 03/20/2002 02:00:25
Martin Husemann writes:

>> >This is not true for any C++ code.
>> 
>> What makes you think that?
>
>I was thinking of argument propagation rules and assignement implicit 
>conversions (when function pointers and pointers to member functions
>are involved) where NULL would have slightly less strict rules (which is
>why g++ implements it as __null) - but I can't find an example where "0"
>does not work right now.

The reason why I questioned your argument was that, while I'm
not a very active C++ programmer, I had the notion in the back
of my head that in C++ it was or is actually conventional to use
a literal 0 -- and not the NULL macro -- for pointer comparison.
A quick googling showed me that at least some folks seem to agree
with that: http://www.nfra.nl/~seg/cppStdDoc.html
In my 2nd revision of Stroustrup (not the newest edition I have
to admit, and probably predates ANSI C++) Stroustrup is using
NULL and 0 interchangeably although from a quick scan I haven't
found out whether he recommends using one over the other.
That 0 all but must be treated as a null pointer in pointer context
is already mandated by C++ being able to correctly parse ANSI/ISO C
program text, where 0 in pointer context always yields a null pointer
(not necessarily the same size as an integer 0 of course or being
represented by all bits zero, this is implementation defined and
the compiler does the conversion transparently.)

--mkb