This is the mail archive of the
mailing list for the GCC project.
Re: Calling va_start multiple times vs __va_copy
Carlo Wood <email@example.com> writes:
> On Fri, Aug 10, 2001 at 08:23:27PM -0300, Alexandre Oliva wrote:
> > On Aug 8, 2001, Carlo Wood <firstname.lastname@example.org> wrote:
> > > It will work with almost all OS, but there is at least one
> > > that I know of where va_list is not a struct but a pointer to
> > > a struct. In the latter case it doesn't work.
> > Well, it should work, according to the standard. Which combination of
> > OS and compiler was that? Perhaps you should file a bug report to the
> > maintainer of that compiler?
> I couldn't remember well enough, but for you I looked in the
> CVS repository and found this comment:
> "This fixes a problem for Power PC platforms (ppc). va_list is an array
> in PPC-SYSV ABI which therefore gets changed after a call to vsendto_one
> etc, which causes core dumps for all the send.c functions with loops."
> This was in June 2000.
The code you gave works fine on powerpc. The usual problems people
have with va_list being an array are caused by passing it as a
procedure parameter and expecting a copy of the va_list to be made
without using the va_copy macro.
- Geoffrey Keating <email@example.com>