Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!henry
From: henry@utzoo.UUCP (Henry Spencer)
Newsgroups: net.lang.c
Subject: Re: Re: if (p), where p is a pointer (REAL portability)
Message-ID: <5987@utzoo.UUCP>
Date: Thu, 19-Sep-85 17:37:13 EDT
Article-I.D.: utzoo.5987
Posted: Thu Sep 19 17:37:13 1985
Date-Received: Thu, 19-Sep-85 17:37:13 EDT
References: <118@mit-hector.UUCP> <4300@alice.UUCP> <11610@rochester.UUCP>, <532@riccb.UUCP>
Organization: U of Toronto Zoology
Lines: 28

> NULL *IS* defined as (char *)0 and SHOULD only be used in comparisons
> with character pointers!

Groan.  Wrong.  K&R page 97:

	#define NULL 0
	...
	We write NULL instead of zero... to indicate more clearly that
	this is a special value for a pointer...

Harbison & Steele, page 94:

	Standard header files usually define the preprocessor macro
	name NULL to be 0.

ANSI X3J11 draft of 30 April 1985, page 67:

	The macros are... NULL... which expands to a constant expression
	whose value compares equal to that of an integral constant
	expression with the value 0, which can be assigned to a pointer
	or used as an argument to represent the null pointer...

(Note that although the ANSI definition uses more complex weasel-wording
than the earlier ones, it still requires that NULL work for pointer types
in general.)
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry