This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: linux libio status
- To: Per Bothner <bothner at cygnus dot com>
- Subject: Re: linux libio status
- From: Peter Seebach <seebs at monolith dot solon dot com>
- Date: Wed, 15 Oct 1997 14:09:52 -0500
- cc: egcs at cygnus dot com
In message <199710151812.LAA15748@cygnus.com>, Per Bothner writes:
>Joe Buck <jbuck@synopsys.com> writes:
>> The comp.lang.c++ tells users "don't use NULL in C++ programming",
>> precisely for this reason.
>I am strongly opposed to any such advice, or to anything that
>makes that advice necessary.
Amen!
>Using NULL instead of 0 makes programs clearer, and is strongly
>to be encouraged.
It also makes a non-empty set of programs *correct*.
However, correctness aside, it is good to use NULL for null pointers,
for the same reason it is good to use "hello, world" rather than
{ 'h', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd' }
to initialize arrays of characters.
(One point extra credit for spotting the difference, two points
extra credit for spotting the case where the two are not different.)
-s