This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Bootstrap failure (Re: [Patch] Java: Prepare for %q, %< and %> in diagnostic messages)
Andrew Haley <aph@redhat.com> writes:
> > Uh, can you do this? Take an address of a va_list object?
>
> It says in 7.15 "va_list is an object type". So, you can take its
> address and later dereference to get an lvalue that is a va_list.
>
> > Wouldn't it be more "correct" to have text.args_ptr be of type
> > va_list and use va_copy instead?
>
> That does sound like a better idea, yes.
We can't count on having va_copy, it's only in C99.
Taking the address of the va_list *in the function that called
va_start*, passing that around, and dereferencing the pointer only
as an immediate operand of va_arg, that works reliably.
Passing the va_list around by value does not work reliably.
zw