On Tue, Oct 15, 2024 at 08:11:02PM +0200, Patrice Dumas wrote:
> > diff --git a/info/util.c b/info/util.c
> > index 7ecb90f06b..a511471b9f 100644
> > --- a/info/util.c
> > +++ b/info/util.c
> > @@ -34,9 +34,12 @@ xvasprintf (char **ptr, const char *template, va_list ap)
> >  int
> >  xasprintf (char **ptr, const char *template, ...)
> >  {
> > +  int ret;
> >    va_list v;
> >    va_start (v, template);
> > -  return xvasprintf (ptr, template, v);
> > +  ret =  xvasprintf (ptr, template, v);
> > +  va_end (v);
> > +  return ret;
> >  }
> 
> If the above change is relevant (looks like so to me), we should
> probably do it in texi2any C code that is very similar too.

The question is do we actually need to use va_end?

>From the libc Info manual:

     In the GNU C Library, ‘va_end’ does nothing, and you need not ever
     use it except for reasons of portability.

and

     (In practice, with most C compilers, calling ‘va_end’ does nothing.
     This is always true in the GNU C compiler.  But you might as well
     call ‘va_end’ just in case your program is someday compiled with a
     peculiar compiler.)

So I suppose we should use va_end throughout, if only to avoid anyone
worrying about it in the future.

Reply via email to