<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] Use NULL in vararg



On Wed, 10 Nov 2004, David Laight wrote:

> On Mon, Nov 08, 2004 at 05:04:58PM +0100, Ralf Wildenhues wrote:
> > -   snprintf (buf, buflen, fmt, Context ? Context->pattern : 0);
> > +   snprintf (buf, buflen, fmt, Context ? Context->pattern : NULL);
> >
> > Use NULL as null pointer in status_format_str in order to be 64bit
> > clean.  (Strictly ANSI-C speaking, one would have to do (void*)0
> > or (void*)NULL here, but in practice, this is sufficient).
>
> Humm.... two things:
>
> 1) NULL ought to be (void *)0 - in the old days it might have just been 0,
>    but given the compiler knows about 'void *', then (void *)0 is good.

iirc, it is C++ that adds a cast, while C doesn't.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net