Tk Source Code

View Ticket
Login
Ticket UUID: 5d2061838b29e8278776468a9bcda2b2c0ed85d4
Title: tk-8.6.17: fails to build with glibc 2.43
Type: Bug Version: 8.6.17
Submitter: anonymous Created on: 2026-02-10 16:33:25
Subsystem: 84. Unix Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-03-10 16:33:29
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-03-10 16:33:29
Description:
./configure --disable-xft results in the build failure:

/var/tmp/paludis/build/dev-lang-tk-8.6.17/work/tk8.6.17/unix/../unix/tkUnixFont.c: In function 'FindSubFontForChar':
/var/tmp/paludis/build/dev-lang-tk-8.6.17/work/tk8.6.17/unix/../unix/tkUnixFont.c:2147:34: error: assignment of read-only location '*(const char *)strchr(fallback, 45)'
 2147 |         strchr(fallback, '-')[0] = '\0';
      |                                  ^
make: *** [Makefile:1202: tkUnixFont.o] Error 1


With

diff -Naur tk8.6.17/unix/tkUnixFont.c tk8.6.17.new/unix/tkUnixFont.c
--- tk8.6.17/unix/tkUnixFont.c	2025-07-31 19:34:04.000000000 +0200
+++ tk8.6.17.new/unix/tkUnixFont.c	2026-02-10 17:06:15.477807885 +0100
@@ -2037,7 +2037,7 @@
 {
     int i, j, k, numNames;
     Tk_Uid faceName;
-    const char *fallback;
+    char *fallback;
     const char *const *aliases;
     char **nameList;
     const char *const *anyFallbacks;

OR

diff -Naur tk8.6.17/unix/tkUnixFont.c tk8.6.17.new/unix/tkUnixFont.c
--- tk8.6.17/unix/tkUnixFont.c	2025-07-31 19:34:04.000000000 +0200
+++ tk8.6.17.new/unix/tkUnixFont.c	2026-02-10 17:03:12.225063968 +0100
@@ -2144,7 +2144,7 @@
     nameList = ListFonts(fontPtr->display, "*", &numNames);
     for (i = 0; i < numNames; i++) {
 	fallback = strchr(nameList[i] + 1, '-') + 1;
-	strchr(fallback, '-')[0] = '\0';
+	*(char *)strchr(fallback, '-') = '\0';
 	if (SeenName(fallback, &ds) == 0) {
 	    subFontPtr = CanUseFallback(fontPtr, fallback, ch,
 		    fixSubFontPtrPtr);

resulting in a working build, not sure if and which one is (more) correct.
User Comments: jan.nijtmans added on 2026-03-10 16:33:29:

Fixed [c07d5817bada4c9b|here]

Closing