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: Sebastian Ude <ude at handshake dot de>
- Subject: Re: Calling va_start multiple times vs __va_copy
- From: Robert Lipe <robertlipe at usa dot net>
- Date: Wed, 8 Aug 2001 08:35:56 -0500
- Cc: gcc at gcc dot gnu dot org
- References: <20010808113530.1903896D4B@sender.ngi.de>
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.
RJL