Skip to content

Tk fails to compile after gcc upgrade from gcc-12 to gcc-14 #120

Description

@jkeenan

A Debian upgrade on my Linux server entailed an upgrade in the default version of gcc on this machine. As an apparent consequence, when I test Tk against development releases of Perl, compilation now fails during make, even though there has been no change within Tk and even when compiling with the same version of Perl.

I first became aware of this when comparing CPANtesters reports for Tk run against perl-5.43.9 and, the following month, perl-5.43.10. In between these two runs, I upgraded from Debian 12 (bookworm) to Debian 13 (trixie).

https://www.cpantesters.org/cpan/report/a0602756-247e-11f1-94b3-e8d499459050

Date: 2026-03-20
Perl version: 5.43.9
Grade: PASS (though no tests were run)
osname=linux
osvers=6.1.0-37-amd64
archname=x86_64-linux
uname='linux jk-bookworm 6.1.0-37-amd64 #1 smp preempt_dynamic debian 6.1.140-1 (2025-05-22) x86_64 gnulinux '
config_args='-des -Dusedevel -Dprefix=/home/jkeenan/testing/perl-5.43.9 -Uversiononly -Dman1dir=none -Dman3dir=none'
gccversion='12.2.0'
Date: 2026-04-20
Perl version: 5.43.10
Grade: UNKNOWN (see below)
osname=linux
osvers=6.12.74+deb13+1-amd64
archname=x86_64-linux
uname='linux jk-trixie 6.12.74+deb13+1-amd64 #1 smp preempt_dynamic debian 6.12.74-2 (2026-03-08) x86_64 gnulinux '
config_args='-des -Dusedevel -Dprefix=/home/jkeenan/testing/perl-5.43.10 -Uversiononly -Dman1dir=none -Dman3dir=none'
gccversion='14.2.0'

tail of make failure:

In file included from Xlib_f.c:17:
Xlib.t:334:1: warning: �XKeycodeToKeysym� is deprecated [-Wdeprecated-declarations]
  334 | VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
      | ^~~~~
In file included from Xlib_f.c:4:
/usr/include/X11/Xlib.h:1683:15: note: declared here
 1683 | extern KeySym XKeycodeToKeysym(
      |               ^~~~~~~~~~~~~~~~
Xlib.t:334:14: error: initialization of �KeySym (*)(Display *, unsigned int,  int)� {aka �long unsigned int (*)(Display *, unsigned int,  int)�} from incompatible pointer type �KeySym (*)(Display *, KeyCode,  int)� {aka �long unsigned int (*)(Display *, unsigned char,  int)�} [-Wincompatible-pointer-types]
  334 | VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
      |              ^~~~~~~~~~~~~~~~
Xlib_f.c:15:35: note: in definition of macro �VFUNC�
   15 | #define VFUNC(type,name,mem,args) name,
      |                                   ^~~~
Xlib.t:334:14: note: (near initialization for �XlibVtable.V_XKeycodeToKeysym�)
  334 | VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
      |              ^~~~~~~~~~~~~~~~
Xlib_f.c:15:35: note: in definition of macro �VFUNC�
   15 | #define VFUNC(type,name,mem,args) name,
      |                                   ^~~~
make[1]: *** [Makefile:868: Xlib_f.o] Error 1
make[1]: Leaving directory '/home/jkeenan/.cpan/build/Tk-804.036-0/pTk'
make: *** [Makefile:1661: pTk/libpTk.a] Error 2

In subsequent months Tk has continued to fail during make. See, for example, this report run yesterday (June 22) against perl-5.44.0-RC1: https://www.cpantesters.org/cpan/report/55e25e2c-6ec2-11f1-9659-e31fbcd3a85a

I wanted to rule out the possibility that this failure was due to a change in Perl itself between 5.43.9 and 5.43.10. So yesterday I re-downloaded the 5.43.9 tarball and installed it in a distinct directory, then attempted to install Tk against it (without trying to generate a CPANtesters report). Of course now there are deeper changes on the machine: Debian 13 and gcc-14. Tk failed during make like this:

cc -c  -I..  -I. -Ibitmaps  -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"804.036\" -DXS_VERSION=\"804.036\" -fPIC "-I/home/jkeenan/testing/alt/perl-5.43.9/lib/5.43.9/x86_64-linux/CORE"    Xlib_f.c
In file included from Xlib_f.c:17:
Xlib.t:334:1: warning: ‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
  334 | VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
      | ^~~~~
In file included from Xlib_f.c:4:
/usr/include/X11/Xlib.h:1683:15: note: declared here
 1683 | extern KeySym XKeycodeToKeysym(
      |               ^~~~~~~~~~~~~~~~
Xlib.t:334:14: error: initialization of ‘KeySym (*)(Display *, unsigned int,  int)’ {aka ‘long unsigned int (*)(Display *, unsigned int,  int)’} from incompatible pointer type ‘KeySym (*)(Display *, KeyCode,  int)’ {aka ‘long unsigned int (*)(Display *, unsigned char,  int)’} [-Wincompatible-pointer-types]
  334 | VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
      |              ^~~~~~~~~~~~~~~~
Xlib_f.c:15:35: note: in definition of macro ‘VFUNC’
   15 | #define VFUNC(type,name,mem,args) name,
      |                                   ^~~~
Xlib.t:334:14: note: (near initialization for ‘XlibVtable.V_XKeycodeToKeysym’)
  334 | VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
      |              ^~~~~~~~~~~~~~~~
Xlib_f.c:15:35: note: in definition of macro ‘VFUNC’
   15 | #define VFUNC(type,name,mem,args) name,
      |                                   ^~~~
make[1]: *** [Makefile:868: Xlib_f.o] Error 1
make[1]: Leaving directory '/home/jkeenan/.cpan/build/Tk-804.036-2/pTk'
make: *** [Makefile:1661: pTk/libpTk.a] Error 2
  SREZIC/Tk-804.036.tar.gz
  /usr/bin/make -- NOT OK

So I infer that Tk needs to be upgraded to compile with gcc-14.

Possibly similar tickets:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions