This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ definition of NULL
- To: egcs at cygnus dot com
- Subject: Re: C++ definition of NULL
- From: Per Bothner <bothner at cygnus dot com>
- Date: Wed, 03 Mar 1999 06:51:25 -0800
"Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de> writes:
> a) Replace all occurences of NULL with 0. This is IMHO the Right Thing
> (tm), because the NULL symbol is an ugly hack, and just there for
> backwards compatibility.
You've got it backwards. It is defining integer literal 0 as the
null pointer which is the ugly hack, but we're stuck with it
because of backwards compatibility.
On the other hand, using NULL as the null pointer is sanctioned
by common sense, tradition, helps code readability, and (using
some name or other) is what every other high-level language
providing pointers does.
The C++ committee blew this one.
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner