[tex-k] xdvik and gcc14, pull request / bug report on github texlive-source

Karl Berry karl at freefriends.org
Sat Feb 24 18:41:59 CET 2024

Hi Christopher, Paul, and all - thanks for the patch you posted to fix
another painful pointer discrepancy:


    --- a/texk/xdvik/gui/pagesel.c
    +++ b/texk/xdvik/gui/pagesel.c
    -    XawListChange(LIST_WIDGET, page_info.page_labels, 0,
    +    XawListChange(LIST_WIDGET, (_Xconst char**) page_info.page_labels, 0,

Unfortunately, at least on my system, Rocky Linux 9, the second argument
XawListChange is *not* const. Thus, after applying the patch, I get a
warning (error in gcc14) on my system (using gcc 11.4 here):

gcc -DHAVE_CONFIG_H -I. -I../../../texk/xdvik  -I../../../texk/xdvik/gui -DPS_GS -I/home/texlive/karl/Build/source/Work/texk -I/home/texlive/karl/Build/source/texk -I/home/texlive/karl/Build/source/Work/libs/freetype2/freetype2     -g -fno-common -Wdeclaration-after-statement -MT gui/pagesel.o -MD -MP -MF $depbase.Tpo -c -o gui/pagesel.o ../../../texk/xdvik/gui/pagesel.c &&\
mv -f $depbase.Tpo $depbase.Po
./../../texk/xdvik/gui/pagesel.c: In function 'xaw_update_list':
./../../texk/xdvik/gui/pagesel.c:541:32: warning: passing argument 2 of 'XawListChange' from incompatible pointer type [-Wincompatible-pointer-types]
  541 |     XawListChange(LIST_WIDGET, (_Xconst char**) page_info.page_labels, 0,
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The arg is an X11 "String" on my system. From my /usr/includeXaw/List.h:
    void XawListChange
     Widget			w,
     String			*list,

I surmise Gentoo, and no doubt others, but evidently not everyone,
changed the X11 String to be const.

Is it still a String on Gentoo? If so, I think we could fix it for all
systems by casting to (String):

--- pagesel.c	(revision 70123)
+++ pagesel.c	(working copy)
@@ -538,7 +538,7 @@
     button_width = get_panel_width() - 2 * (resource.btn_side_spacing + resource.btn_border_width);
     /* delete and re-create list */
     ASSERT(total_pages <= (int)page_info.index_size, "");
-    XawListChange(LIST_WIDGET, page_info.page_labels, 0,
+    XawListChange(LIST_WIDGET, (String *) page_info.page_labels, 0,
 		  MAX(button_width, pagelist_width), False);
     /* restore selected item */
     if (idx != XAW_LIST_NONE) {

Christopher, does that work on your system? --thanks, karl.

More information about the tex-k mailing list.