https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14557

--- Comment #21 from felix <felix.von.s at posteo dot de> ---
> va_list ap2;
> va_copy(ap2, ap);

> and then use &ap2, this always works.

> the proposed macros are both broken and unnecessary.

That's not equivalent. Using va_arg(ap2, T) does not propagate state changes
back to ap, which is the main motivation to form a pointer to ap in the first
place. The macros do that just fine. You mean they are unportable? That part is
true, I admitted as much. Pick your poison.

As for being unnecessary, I vaguely remember gnulib trying to use internal
helper functions with va_list * parameter in their vfprintf implementation. I
cannot find the link now, unfortunately. But there are also duplicates to this
very report, so clearly the need is there.

Reply via email to