This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: va_arg *, and why not.
On Mon, Jul 17, 2000 at 08:27:24AM -0700, Mark Mitchell wrote:
> A better attempt is to use `memcpy', I think.
No, that's worse in that you get run-time errors instead
of compile-time errors. To wit:
typedef struct { ... } va_list[1];
void foo(va_list s)
{
va_list d;
memcpy (&d, &s, sizeof(va_list));
}
does not copy the contents of the incoming structure, but
rather the contents of the incoming pointer.
Franz posted a functional workaround.
r~