Subject: Re: CVS commit: src/sys/sys
To: David Laight <david@l8s.co.uk>
From: Simon Burge <simonb@wasabisystems.com>
List: source-changes
Date: 10/21/2003 19:22:10
David Laight wrote:

> > Modified Files:
> > 	src/sys/sys: null.h
> > 
> > Log Message:
> > Define NULL as (void *)0, unless C++ is being used.
> 
> I don't believe that is valid portable C.
> Although off hand I dont know the counter example.

C99 says:


	The macros are

               NULL

	which expands  to  an  implementation-defined  null  pointer
	constant; and ...

> What about the comparison of function pointers?

gcc331 and lint are both happy with this.

> I just remember reading somewhere that the only valid
> definition for NULL is 0.

What Frank has done doesn't appear to be against any standards
that I can find...

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/