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: linux libio status


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


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