[Bug c/94222] Architecture dependent problem with vsnprintf

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 19 17:20:26 GMT 2020


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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jaroslav Fojtík from comment #2)
> Sorry, it worked for many years without any problems. I has been fixed a
> problem in my WP2LaTeX now.

Well it depends on the ABI for va_list .  On the targets where it works, it is
just a pointer which is passed via value and does not get changed by the first
vnsprintf.  On targets where it does not work, va_list is an array of size 1 of
a struct; there for is passed via reference really and gets changed by the
first vnsprintf.

That is why it was working before hand but only on accident.  There are many
documentation about this issue for the last 20 years really since va_copy was
added in C99.

https://www.gnu.org/software/libc/manual/html_node/Argument-Macros.html


More information about the Gcc-bugs mailing list