va_arg *, and why not.

Gabriel Dos Reis gdr@codesourcery.com
Sun Jul 16 21:57:00 GMT 2000


Geoff Keating <geoffk@cygnus.com> writes:

| > 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...

For some reason, I thought a function parameter is a local variable...


-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com


More information about the Gcc-bugs mailing list