This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: va_arg *, and why not.


>>>>> "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.
Perhaps this should go in system.h instead; I'm not sure whether
including the <stdarg.h> stuff in libiberty.h is a good idea or not.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]