bug-texinfo
[Top][All Lists]
Advanced

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

Re: Texinfo 6.7 released


From: Eli Zaretskii
Subject: Re: Texinfo 6.7 released
Date: Sat, 28 Sep 2019 13:53:35 +0300

> From: Gavin Smith <address@hidden>
> Date: Sat, 28 Sep 2019 11:20:29 +0100
> Cc: Texinfo <address@hidden>
> 
> > I needed to add dTHX to 'init', or it wouldn't compile.
> 
> Didn't it compile before?

It did, because there was no stderr in that function.  Once I removed
the printf's, the dTHX is no longer needed in that function.

> > --- ./tp/Texinfo/XS/parsetexi/api.c.~1~ 2019-08-25 20:11:45.000000000 +0300
> > +++ ./tp/Texinfo/XS/parsetexi/api.c     2019-09-28 10:50:13.319625000 +0300
> > @@ -56,7 +56,8 @@ find_locales_dir (char *builddir)
> >
> >    dTHX;
> >
> > -  asprintf (&s, "%s/LocaleData", builddir);
> > +  s = malloc (strlen (builddir) + strlen ("/LocaleData") + 1);
> > +  sprintf (s, "%s/LocaleData", builddir);
> >    dir = opendir (s);
> >    if (!dir)
> >      {
> >
> >
> > and the problem went away.
> 
> Would you like to commit that change?

Done, with a comment explaining why asprintf cannot be used there.

> I don't know of a good way to avoid using the Perl version of free.

I don't think there is one.  I think we will have to be vigilant and
avoid using Gnulib functions that allocate storage without freeing it,
in files that include Perl headers.

> > If this is the right fix, then I think we
> > cannot use Gnulib's asprintf in Parsetexi, and there are a couple of
> > other places with the same problem, which we need to fix as well,
> > right?
> 
> Hopefully not: only if Perl headers are included in a file should
> there be problems.

Ah, I see that the other grep hits were indeed in files that don't
include Perl headers.  So we are safe, I think.

> I deliberately limited where the Perl headers were included: for
> example, in tree_types.h a field of a struct is declared as a void
> pointer rather than the Perl type it should be. The files where there
> could be problems are api.c and Parsetexi.xs: it shouldn't be too hard
> to avoid using asprintf there (or other functions which use the real
> version of malloc).

Right.

I will run the test suite now.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]