[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: varargs related bug in gtk-gnutella

On Sun, 2002-07-21 at 19:30, jtv wrote:
> On Sun, Jul 21, 2002 at 01:22:12PM -0400, Daniel Jacobowitz wrote:
> > 
> > You're right.  Using a va_list after it has been passed to a function
> > which uses it has undefined behaviour, IIRC.  You probably want to call
> > va_copy, pass the copy to the child function, and then (to be
> > technically correct) va_end it in the caller.
> Sounds about right...  from the manpage:
>        If  ap  is  passed to a function that uses va_arg(ap,type)
>        then the value of ap is undefined after the return of that
>        function.
> Reading the rest of the page, however, I don't see any reason not to 
> re-initialize a va_list with a new va_start afterwards, even if it its 
> value does become undefined first.

Thanks Dan and Jeroen, I hope this helps the maintainer and/or upstream
developers. Or maybe I'll try to come up with a fix when I get around to

Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast

To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: