NULL v. zero
Posted Jul 15, 2004 19:43 UTC (Thu) by
Ross (subscriber, #4065)
In reply to:
NULL v. zero by ikm
Parent article:
NULL v. zero
I don't see Linus saying that 0 can't be used as a NULL pointer. In fact
it clearly works since it is spread all over the kernel. It is just way
better to use NULL for pointers, 0 for ints, 0U for unsigned ints, '\0'
for chars, etc. so that it is clear what the constant is supposed to be.
This is a style issue and not a standards compliance issue.
(C++ people would disagree and say that 0 is the correct value for the
null pointer but I just have to say that C++ is broken in that respect.)
(
Log in to post comments)