This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++ definition of NULL


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]