Re: NULL vs 0 vs 0L bikeshed time

From: Thomas David Rivers <rivers_at_dignus.com>
Date: Mon, 1 Mar 2004 08:15:57 -0500 (EST)
> 
> 1) Please restrain the need to bikeshed this one to death. I am
>    sympathetic to technical arguments, but compulsive noise over
>    such issues is annoying.
> 
> 2) Please separate style disussion from technical discussion.
> 
> I'd like to commit the following patch. It makes sure that for C
> and the kernel, NULL is a ((void *)0), and for C++, NULL is either
> (0L) or 0, with __LP64__ used to define the difference.
> 
> The intent is to catch use of NULL where 0 or (0L) should be used.
> It generates extra warnings (I promise to fix these).
> 

 I believe that _may_ be backwards; the C and C++ standards
 speak to this, and both of them have slightly different
 requirements.

 The C standard discuss the NULL constant, implying it is simply
 a zero (not necessarily cast to a pointer.)

 But - I believe (and I need to check on this) that the C++
 standard requires the NULL constant to be a pointer type (so
 various conversions work.)

 So - before doing this; it might be nice to review the various
 standards to see if it's applicable.

	- Dave Rivers -

--
rivers_at_dignus.com                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com
Received on Mon Mar 01 2004 - 04:17:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:45 UTC