Re: execl() sentinel - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: execl() sentinel
Date
Msg-id 20070718212235.GA23029@alvh.no-ip.org
Whole thread Raw
In response to Re: execl() sentinel  (Neil Conway <neilc@samurai.com>)
Responses Re: execl() sentinel
List pgsql-patches
Neil Conway wrote:
> On Wed, 2007-07-18 at 16:59 +0200, Peter Eisentraut wrote:
> > It might be good to check the actual definition of NULL in this case, however,
> > before wondering further.
>
> Well, the existing coding is plainly wrong, regardless of the NULL
> implementation used on any given machine (although it will usually
> work). The simple rule is "you need to cast NULL to a pointer type when
> passing arguments to a variadic function, or to a function whose
> prototype is not in scope".
>
> So +1 on this patch from me.

Thanks, committed.  I looked for other uses of execl(), execle() and
execlp() and found a single one of execl() which is already OK.

I wouldn't know how to look for other variadic functions using NULL
sentinels though.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: execl() sentinel
Next
From: Neil Conway
Date:
Subject: Re: execl() sentinel