[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: texinfo-6.5.92 pretest
From: |
Eli Zaretskii |
Subject: |
Re: texinfo-6.5.92 pretest |
Date: |
Mon, 04 Feb 2019 19:32:42 +0200 |
> From: Gavin Smith <address@hidden>
> Date: Fri, 1 Feb 2019 16:34:25 +0000
>
> A pretest release for Texinfo has been uploaded to
>
> https://alpha.gnu.org/gnu/texinfo/texinfo-6.5.92.tar.xz
I've built this pretest with MinGW on MS-Windows. The build was
successful, but I found a few minor issues and observations which I
want to report:
1) misc.c in tp/Texinfo/XS didn't compile, because one of the
functions uses malloc, but doesn't have the dTHX preamble. Fixed
like this:
--- ./tp/Texinfo/XS/misc.c~0 2019-01-13 13:43:11.000000000 +0200
+++ ./tp/Texinfo/XS/misc.c 2019-02-04 18:41:07.183392600 +0200
@@ -395,6 +395,8 @@ xs_process_text (char *text)
static char *new;
char *p, *q;
+ dTHX;
+
new = realloc (new, strlen (text) + 1);
strcpy (new, text);
2) Parsetexi.c didn't compile because one of the Windows headers
defines CM_NONE to a numeric constant, and then the enumeration in
command_ids.h causes the compiler to barf. To fix this, I inserted
#undef CM_NONE in command_ids.h, but I understand that the actual
change should be in the awk script that produces it.
3) Compilation warning in Parsetexi.c:
In file included from C:/Perl/lib/CORE/perl.h:5544:0,
from parsetexi/Parsetexi.xs:6:
parsetexi/Parsetexi.c: In function 'XS_Parsetexi_get_root':
parsetexi/Parsetexi.c:326:19: warning: cast from pointer to integer of
different size [-Wpointer-to-int-cast]
XSprePUSH; PUSHu((UV)RETVAL);
^
C:/Perl/lib/CORE/embed.h:677:46: note: in definition of macro 'sv_setuv'
#define sv_setuv(a,b) Perl_sv_setuv(aTHX_ a,b)
^
parsetexi/Parsetexi.c:326:13: note: in expansion of macro 'PUSHu'
XSprePUSH; PUSHu((UV)RETVAL);
^~~~~
The problem here is that RETVAL is a pointer, whereas the UV type
is unsigned long long on Windows. So a 32-bit build causes this
warning. To fix, I suggest to use this:
XSprePUSH; PUSHu((UV)(uintptr_t)RETVAL);
i.e. cast through intptr_t.
AFAIU, this change should be made in Parsetexi.xs, which btw is not
in the tarball, I guess by mistake?
4) Another compilation warning in parsetexi/input.c:
parsetexi/input.c: In function 'convert_to_utf8':
parsetexi/input.c:220:38: warning: passing argument 3 of
'text_buffer_iconv' from incompatible pointer type
[-Wincompatible-pointer-types]
&inptr, &bytes_left);
^
parsetexi/input.c:113:1: note: expected 'const char **' but argument is of
type 'char **'
text_buffer_iconv (TEXT *buf, iconv_t iconv_state,
^~~~~~~~~~~~~~~~~
I suggest to fix like this:
--- ./tp/Texinfo/XS/parsetexi/input.c~0 2019-01-29 15:47:29.000000000 +0200
+++ ./tp/Texinfo/XS/parsetexi/input.c 2019-02-04 18:54:46.061326200 +0200
@@ -140,7 +140,7 @@ convert_to_utf8 (char *s, char *input_en
{
iconv_t our_iconv;
static TEXT t;
- char *inptr; size_t bytes_left;
+ ICONV_CONST char *inptr; size_t bytes_left;
size_t iconv_ret;
enum character_encoding enc;
5) The test suite ran successfully, no failures.
6) "make install" installs some files that I didn't expect to be
installed: static libraries XSParagraph.a, TestXS.a, MiscXS.a, and
Parsetexi.a, and TestXS.dll. Is this intentional? I don't see any
use for these files in the binary installation.
7) I timed texi2any producing the ELisp reference manual with
TEXINFO_XS_PARSER=1, and saw a significant speed-up, from 12 sec
with just TEXINFO_XS=required to 7.5 sec with the new parser. This
is very good news, thanks for developing this feature!
Let me know if you want me to provide more information about the above.
Thanks.