This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: va_arg *, and why not.
> Cc: gcc-bugs@gcc.gnu.org, gdr@codesourcery.com
> From: Mark Mitchell <mark@codesourcery.com>
> Date: Sun, 16 Jul 2000 20:34:23 -0700
> >>>>> "Geoff" == Geoff Keating <geoffk@cygnus.com> writes:
>
> Geoff> The tricky part is that the equivalent can't be a function
> Geoff> that takes a va_list, otherwise you end up in the same
> Geoff> dead-end: you don't know if the parameter is a pointer or a
> Geoff> value.
>
> Right. I'm sorry, I meant to imply a libiberty macro. Something
> like:
>
> #ifndef va_copy
> #define va_copy(DEST, SRC) \
> memcpy (&DEST, &SRC, sizeof (va_list))
> #endif
>
> would probably do the trick, after including the right header files.
Mind, this doesn't work either if DEST or SRC is a parameter to the
procedure using the macro. It has to be a local variable...
--
- Geoffrey Keating <geoffk@cygnus.com>