This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: va_arg *, and why not.
> From: Mark Mitchell <mark@codesourcery.com>
> Date: Sun, 16 Jul 2000 19:00:04 -0700
...
> va_list ap;
>
> memcpy ((PTR) &ap, (PTR) args, sizeof (va_list));
> Does that not work on your platform? If not, this code should be
> changed, too.
No, that works. It's only taking the address of a va_arg argument
that doesn't do what you'd like.
> I think that the right solution here is that the diagnostic buffer to
> contain a va_list, and that we initialize it either with va_copy (if
> available) or an as-yet-nonexistant libiberty equivalent, presumably
> using the `memcpy' trick shown above.
The tricky part is that the equivalent can't be a function that takes
a va_list, otherwise you end up in the same dead-end: you don't know
if the parameter is a pointer or a value.
--
- Geoffrey Keating <geoffk@cygnus.com>