texlive[74888] Build/source/texk: begin groveling to C23 (fixes
commits+karl at tug.org
commits+karl at tug.org
Wed Apr 9 00:40:49 CEST 2025
Revision: 74888
https://tug.org/svn/texlive?view=revision&revision=74888
Author: karl
Date: 2025-04-09 00:40:48 +0200 (Wed, 09 Apr 2025)
Log Message:
-----------
begin groveling to C23 (fixes mostly from Hilmar)
Modified Paths:
--------------
trunk/Build/source/texk/dvi2tty/dvi2tty-src/Changelog
trunk/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h
trunk/Build/source/texk/dviljk/ChangeLog
trunk/Build/source/texk/dviljk/config.h
trunk/Build/source/texk/dvipsk/ChangeLog
trunk/Build/source/texk/dvipsk/afm2tfm.c
trunk/Build/source/texk/dvipsk/t1part.h
trunk/Build/source/texk/gregorio/TLpatches/ChangeLog
trunk/Build/source/texk/gregorio/gregorio-src/src/bool.h
trunk/Build/source/texk/kpathsea/ChangeLog
trunk/Build/source/texk/kpathsea/c-memstr.h
trunk/Build/source/texk/ps2pk/ChangeLog
trunk/Build/source/texk/ps2pk/fontstruct.h
trunk/Build/source/texk/ps2pk/spaces.h
trunk/Build/source/texk/seetexk/ChangeLog
trunk/Build/source/texk/seetexk/tempfile.c
Added Paths:
-----------
trunk/Build/source/texk/gregorio/TLpatches/patch-04-bool
Modified: trunk/Build/source/texk/dvi2tty/dvi2tty-src/Changelog
===================================================================
--- trunk/Build/source/texk/dvi2tty/dvi2tty-src/Changelog 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/dvi2tty/dvi2tty-src/Changelog 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,4 +1,6 @@
/******************************************************************************
+ * Hilmar Preusse: 250408 (hille42 at web.de)
+ * Use <stdbool.h> instead of declaring bool, to placate C23.
* Takuji Tanaka: 20160305 (ttk at t-lab.opal.ne.jp)
* Version 6.0.0
* Supported T1,TS1,OT2,T2A,T2B,T2C,X2 encodings.
Modified: trunk/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h
===================================================================
--- trunk/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h 2025-04-08 22:40:48 UTC (rev 74888)
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <stdbool.h>
#if (defined(WIN32) && !defined(__MINGW32__))
# include <fcntl.h>
@@ -101,7 +102,8 @@
* Type definitions
*/
-typedef char bool;
+/* C23 makes "bool" into a keyword; must use <stdbool.h> as above. */
+/* typedef char bool; */
typedef struct prlistptr { /* list of pages selected for output */
int pag; /* number of pages */
Modified: trunk/Build/source/texk/dviljk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dviljk/ChangeLog 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/dviljk/ChangeLog 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,3 +1,10 @@
+2025-04-08 Karl Berry <karl at freefriends.org>
+
+ * config.h (<stdbool.h>): #include to get bool.
+ (bool) [__riscos]: do not define bool, since
+ C23 makes "bool" into a keyword.
+ Report from Hilmar Preusse, 3 Apr 2025 23:54:54.
+
2022-08-30 Karl Berry <karl at freefriends.org>
* Makefile.am (dvilj.man): TeX Live, not TeX-Live.
Modified: trunk/Build/source/texk/dviljk/config.h
===================================================================
--- trunk/Build/source/texk/dviljk/config.h 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/dviljk/config.h 2025-04-08 22:40:48 UTC (rev 74888)
@@ -15,6 +15,8 @@
#define USEPXL
+#include <stdbool.h>
+
#ifdef __riscos
/* #define RISC_USE_OSL */ /* use file functions of OSlib */
/* #define RISC_BUFFER */ /* buffer output */
@@ -163,15 +165,6 @@
#define STRSIZE 255 /* stringsize for file specifications */
-#ifdef __riscos
-# ifndef types_H /* for compatibility with OSLib */
-typedef int bool;
-# endif
-#else
-typedef char bool;
-#endif
-
-
/* The smallest signed type: use `signed char' if ANSI C, `short' if
char is unsigned, otherwise `char'. */
#ifndef SCHAR_TYPE
Modified: trunk/Build/source/texk/dvipsk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipsk/ChangeLog 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/dvipsk/ChangeLog 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,3 +1,10 @@
+2025-04-08 Karl Berry <karl at freefriends.org>
+
+ * t1part.h (search),
+ * afm2tfm.c (fopen): remove () declaration, since C23
+ backward-incompatibly considers it the same as (void).
+ Report from Hilmar Preusse, 3 Apr 2025 23:54:54.
+
2025-03-07 Karl Berry <karl at tug.org>
* TL'25 release.
Modified: trunk/Build/source/texk/dvipsk/afm2tfm.c
===================================================================
--- trunk/Build/source/texk/dvipsk/afm2tfm.c 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/dvipsk/afm2tfm.c 2025-04-08 22:40:48 UTC (rev 74888)
@@ -68,7 +68,6 @@
/* debug.h redefines fopen to my_real_fopen, but it's still a FILE * */
#ifdef fopen
#undef fopen
-extern FILE *fopen ();
#endif
struct encoding {
Modified: trunk/Build/source/texk/dvipsk/t1part.h
===================================================================
--- trunk/Build/source/texk/dvipsk/t1part.h 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/dvipsk/t1part.h 2025-04-08 22:40:48 UTC (rev 74888)
@@ -35,7 +35,6 @@
#endif
#ifdef DVIPS
-extern FILE *search();
#ifndef KPATHSEA
extern char *headerpath;
#endif /* not KPATHSEA */
Modified: trunk/Build/source/texk/gregorio/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/texk/gregorio/TLpatches/ChangeLog 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/gregorio/TLpatches/ChangeLog 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,3 +1,7 @@
+2025-04-08 Karl Berry <karl at freefriends.org>
+
+ * patch-04-bool: new file to placate C23.
+
2019-12-19 Akira Kakuto <kakuto at w32tex.org>
Import gregorio-5.2.1.
Added: trunk/Build/source/texk/gregorio/TLpatches/patch-04-bool
===================================================================
--- trunk/Build/source/texk/gregorio/TLpatches/patch-04-bool (rev 0)
+++ trunk/Build/source/texk/gregorio/TLpatches/patch-04-bool 2025-04-08 22:40:48 UTC (rev 74888)
@@ -0,0 +1,14 @@
+--- bool.h (revision 74875)
++++ bool.h (working copy)
+@@ -23,7 +23,10 @@
+ #ifndef BOOL_H
+ #define BOOL_H
+
+-typedef unsigned int bool;
++#include <stdbool.h>
++
++/* C23 makes a typedef bool into an error. */
++/* typedef unsigned int bool; */
+ #define true 1
+ #define false 0
+
Modified: trunk/Build/source/texk/gregorio/gregorio-src/src/bool.h
===================================================================
--- trunk/Build/source/texk/gregorio/gregorio-src/src/bool.h 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/gregorio/gregorio-src/src/bool.h 2025-04-08 22:40:48 UTC (rev 74888)
@@ -23,7 +23,10 @@
#ifndef BOOL_H
#define BOOL_H
-typedef unsigned int bool;
+#include <stdbool.h>
+
+/* C23 makes a typedef bool into an error. */
+/* typedef unsigned int bool; */
#define true 1
#define false 0
Modified: trunk/Build/source/texk/kpathsea/ChangeLog
===================================================================
--- trunk/Build/source/texk/kpathsea/ChangeLog 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/kpathsea/ChangeLog 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,3 +1,10 @@
+2025-04-08 Karl Berry <karl at freefriends.org>
+
+ * c-memstr.h (strtok, strstr): remove () fallback declarations,
+ since C23 considers that the same as (void). Apparently
+ HAVE_STRING_H was not defined, either.
+ Report from Hilmar, 3 Apr 2025 23:54:54.
+
2025-03-08 Karl Berry <karl at tug.org>
* version.ac: 6.4.2/dev.
Modified: trunk/Build/source/texk/kpathsea/c-memstr.h
===================================================================
--- trunk/Build/source/texk/kpathsea/c-memstr.h 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/kpathsea/c-memstr.h 2025-04-08 22:40:48 UTC (rev 74888)
@@ -53,11 +53,4 @@
#define memcpy(to, from, len) bcopy ((from), (to), (len))
#endif
-#if !defined(HAVE_STRING_H)
-extern char *strtok ();
-#ifndef strstr
-extern char *strstr ();
-#endif
-#endif
-
#endif /* not KPATHSEA_C_MEMSTR_H */
Modified: trunk/Build/source/texk/ps2pk/ChangeLog
===================================================================
--- trunk/Build/source/texk/ps2pk/ChangeLog 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/ps2pk/ChangeLog 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,5 +1,12 @@
2025-04-08 Karl Berry <karl at freefriends.org>
+ * fontstruct.h: note that the integer types in the new
+ prototype are "incompatible", causing warnings before C23.
+ * spaces.h (XYspace): disable my attempted prototypes,
+ the calls are incompatible even before C23.
+
+2025-04-08 Karl Berry <karl at freefriends.org>
+
Partially placate C23's backward incompatible requirements. Sigh.
* fontfcn.h (Type1CloseFont): arg is FontPtr.
Modified: trunk/Build/source/texk/ps2pk/fontstruct.h
===================================================================
--- trunk/Build/source/texk/ps2pk/fontstruct.h 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/ps2pk/fontstruct.h 2025-04-08 22:40:48 UTC (rev 74888)
@@ -119,6 +119,9 @@
char scan;
fsBitmapFormat format;
int (*get_glyphs) ( /* font, count, chars, encoding, count, glyphs */
+/* The integer types are incompatible with the uint32_t and similar used
+ in the calls. I guess have to insert explicit casts? Not done.
+ --karl, 8apr25. */
struct _Font *pFont, unsigned long count,
unsigned char *chars, int charEncoding,
unsigned *glyphCount,
Modified: trunk/Build/source/texk/ps2pk/spaces.h
===================================================================
--- trunk/Build/source/texk/ps2pk/spaces.h 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/ps2pk/spaces.h 2025-04-08 22:40:48 UTC (rev 74888)
@@ -67,7 +67,19 @@
struct XYspace {
XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
/* type = SPACETYPE */
- /* calculate "fractpoint" X,Y from float X,Y [= FXYconvert]: */
+ void (*convert)(); /* calculate "fractpoint" X,Y from float X,Y */
+ void (*iconvert)(); /* calculate "fractpoint" X,Y from int X,Y */
+ fractpel (*xconvert)(); /* subroutine of convert */
+ fractpel (*yconvert)(); /* subroutine of convert */
+ fractpel (*ixconvert)(); /* subroutine of iconvert */
+ fractpel (*iyconvert)(); /* subroutine of iconvert */
+#if 0
+/* These were my attempts at the C23-required replacement declarations
+ with all argument types (I gave up at ixconvert and iyconvert). But
+ the result still gets errors about incompatible types, so leaving
+ them disabled. The [=...] are my attempts at listing the functions
+ that get assigned to these structure members. --karl, 8apr25 */
+ /* calculate "fractpoint" X,Y from float X,Y [=FXYconvert]: */
void (*convert)(struct fractpoint *,struct XYspace *,double,double);
/* calculate "fractpoint" X,Y from int X,Y [=ForceFloat,IXYConvert]: */
void (*iconvert)(struct fractpoint *,struct XYspace *,long,long);
@@ -79,6 +91,7 @@
fractpel (*ixconvert)();
/* subroutine of iconvert [=same] */
fractpel (*iyconvert)();
+#endif
int ID; /* unique identifier (used in font caching) */
unsigned char context; /* device context of coordinate space */
struct doublematrix tofract; /* xform to get to fractional pels */
Modified: trunk/Build/source/texk/seetexk/ChangeLog
===================================================================
--- trunk/Build/source/texk/seetexk/ChangeLog 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/seetexk/ChangeLog 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,3 +1,9 @@
+2025-04-08 Karl Berry <karl at freefriends.org>
+
+ * tempfile.c (getenv): do not declare, since C23 makes ()
+ equivalent to void. Report from Hilmar Preusse,
+ 3 Apr 2025 23:54:54.
+
2023-08-23 TANAKA Takuji <ttk at t-lab.opal.ne.jp>
* seetexk.test: Tweak.
Modified: trunk/Build/source/texk/seetexk/tempfile.c
===================================================================
--- trunk/Build/source/texk/seetexk/tempfile.c 2025-04-08 20:42:34 UTC (rev 74887)
+++ trunk/Build/source/texk/seetexk/tempfile.c 2025-04-08 22:40:48 UTC (rev 74888)
@@ -1,4 +1,4 @@
-/* Copyright (c) 1987, 1989, 2012 University of Maryland Department of
+/* Copyright (c) 1987, 1989, 2012, 2025 University of Maryland Department of
Computer Science.
Permission is hereby granted, free of charge, to any person obtaining
@@ -39,9 +39,6 @@
#include "types.h"
#else
#include <sys/file.h>
-
-char *getenv();
-
#endif
#include "tempfile.h"
More information about the tex-live-commits
mailing list.