This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Calling va_start multiple times vs __va_copy
- To: robertlipe at usa dot net
- Subject: Re: Calling va_start multiple times vs __va_copy
- From: Sebastian Ude <ude at handshake dot de>
- Date: Wed, 08 Aug 2001 15:46:34 +0200
- Cc: gcc at gcc dot gnu dot org
- References: <20010808083556.A16750@rjlhome.caldera.com>
- Reply-To: ude at handshake dot de
On Wed, 8 Aug 2001, robertlipe@usa.net (Robert Lipe) wrote:
> Date: Wed, 8 Aug 2001 08:35:56 -0500
> To: Sebastian Ude <ude@handshake.de>
> From: robertlipe@usa.net (Robert Lipe)
> CC: gcc@gcc.gnu.org
> Subject: Re: Calling va_start multiple times vs __va_copy
>
> Sebastian Ude wrote:
>
> > Is it legitime to parse the optional arguments in a variadic function
> > multiple times _without_ copying the va_list through (__)va_copy ?
>
> The standard doesn't appear to forbid it. In the non-normative text
> if Plauger's "The Standard C Library" it says "Once ou execute va_end
> you must not again execute va_arg unless you first execute va_start to
> initiate a rescan." This appears to give extra credence to the
> restartability.
>
> > Can a va_list be started multiple times through va_start ?
>
> As long as there are matching va_ends, yes.
>
> > But, __va_copy does not belong to the ISO standard, right ?
>
> '__va_copy' does not, but 'va_copy' does appear in C99.
Okay, thanks for the information.