This is the mail archive of the gcc@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: Problem with new stdarg implementation (gcc >= 2.9x)


On Thu, Oct 21, 1999 at 02:21:49PM +0400, Yuri Pudgorodsky wrote:
>     memcpy(datum, va_arg(ap, typeof(char[size])), size);

What exactly did you think this was doing?  It's not
surprising at all that it doesn't do what you think.

> I cannot find a workaround, how can someone code the same task:
> takes a variable-sized structure passed by value from a
> function with (...).

You don't.

> I have the only idea for today: throw away
> gcc's builtin stdarg implementation, and use some old portable
> C-only implementation to traverse ap manually.

There is no portable implementation.  Period.

The only portable way to pass a variable amount of data is to
pass it by reference and make a copy in the callee (if needed).


r~


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