httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Richards <p.richa...@elsevier.co.uk>
Subject Re: I *don't* want Paul's style guide.
Date Tue, 02 Jul 1996 14:09:26 GMT
Ben Laurie writes:
 > > In particular what happens when sizeof(char *) > sizeof(int)
 > > e.g. Cray or Digital UNIX, or when NULL != (void *)0 (maybe on some
 > > microsoft systems) ?
 > 
 > Also quoting K&R: "The symbolic constant NULL is often used in place of zero".

Yeah but the next line says

"The symbolic constant NULL is often used in place of zero, as a mnemonic
to indicate *more clearly* that this is a special value for a pointer"

emphasis is obviously mine :-)

Just above that it says "Pointers and integers are not interchangeable. Zero
is the sole exception...", which is why using NULL is good practice to
clearly show it's a pointer and not an integer that's being used.

A null pointer is definately zero, from the Appendix in K&R

A6.6

An integral constant expression with value 0, or such an expression cast to
type void *, may be converted, by a cast, by assignment, or by comparison,
to a pointer of any type. This produces a null pointer that is equal to another
null pointer of the same type, but unequal to any pointer to a function or
object.


Mime
View raw message