Hi,
mingw builds based on MSYS2 (instead of Cygwin) use a newer version of mingw
and a newer gcc as well. In this environment, I get a compilation error:
--------------------------------------------------------------------------------
gcc -DHAVE_CONFIG_H -I. -I../../info -I.. -I../.. -I../../gnulib/lib
-I../gnulib/lib -DLOCALEDIR=\"/mingw64/share/locale\"
-DINFODIR=\"/mingw64/share/info\" -DINFODIR2=\"/mingw64/share/info\"
-DSYSCONFDIR=\"/mingw64/etc\" -DPKGDATADIR=\"/mingw64/share/texinfo\" -Wall
-I/mingw64/include -g -O2 -MT signals.o -MD -MP -MF .deps/signals.Tpo -c -o
signals.o ../../info/signals.c
../../info/signals.c: In function 'initialize_info_signal_handler':
../../info/signals.c:111:45: error: assignment to 'signal_info' {aka 'void
(*)(void)'} from incompatible pointer type '__p_sig_fn_t' {aka 'void (*)(int)'}
[-Wincompatible-pointer-types]
111 | #define set_termsig(sig, old) (void)(*(old) = signal (sig,
info_signal_proc))
| ^
../../info/signals.c:143:3: note: in expansion of macro 'set_termsig'
143 | set_termsig (SIGINT, &old_INT);
| ^~~~~~~~~~~
../../info/signals.c:110:16: note: 'signal_info' declared here
110 | typedef void (*signal_info) ();
| ^~~~~~~~~~~
In file included from ../../info/signals.c:27:
D:/a/_temp/msys64/mingw64/include/signal.h:43:32: note: '__p_sig_fn_t' declared
here
43 | typedef void (__cdecl *__p_sig_fn_t)(int);
| ^~~~~~~~~~~~
../../info/signals.c:111:45: error: assignment to 'signal_info' {aka 'void
(*)(void)'} from incompatible pointer type '__p_sig_fn_t' {aka 'void (*)(int)'}
[-Wincompatible-pointer-types]
111 | #define set_termsig(sig, old) (void)(*(old) = signal (sig,
info_signal_proc))
| ^
../../info/signals.c:147:3: note: in expansion of macro 'set_termsig'
147 | set_termsig (SIGTERM, &old_TERM);
| ^~~~~~~~~~~
../../info/signals.c:110:16: note: 'signal_info' declared here
110 | typedef void (*signal_info) ();
| ^~~~~~~~~~~
D:/a/_temp/msys64/mingw64/include/signal.h:43:32: note: '__p_sig_fn_t' declared
here
43 | typedef void (__cdecl *__p_sig_fn_t)(int);
| ^~~~~~~~~~~~
../../info/signals.c: In function 'info_signal_proc':
../../info/signals.c:112:56: error: passing argument 2 of 'signal' from
incompatible pointer type [-Wincompatible-pointer-types]
112 | #define restore_termsig(sig, saved) (void)signal (sig, *(saved))
| ^~~~~~~~
| |
| signal_info {aka
void (*)(void)}
../../info/signals.c:246:9: note: in expansion of macro 'restore_termsig'
246 | restore_termsig (sig, old_signal_handler);
| ^~~~~~~~~~~~~~~
D:/a/_temp/msys64/mingw64/include/signal.h:55:56: note: expected '__p_sig_fn_t'
{aka 'void (*)(int)'} but argument is of type 'signal_info' {aka 'void
(*)(void)'}
55 | __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func);
| ~~~~~~~~~~~~~^~~~~
D:/a/_temp/msys64/mingw64/include/signal.h:43:32: note: '__p_sig_fn_t' declared
here
43 | typedef void (__cdecl *__p_sig_fn_t)(int);
| ^~~~~~~~~~~~
../../info/signals.c:110:16: note: 'signal_info' declared here
110 | typedef void (*signal_info) ();
| ^~~~~~~~~~~
../../info/signals.c:111:45: error: assignment to 'signal_info' {aka 'void
(*)(void)'} from incompatible pointer type '__p_sig_fn_t' {aka 'void (*)(int)'}
[-Wincompatible-pointer-types]
111 | #define set_termsig(sig, old) (void)(*(old) = signal (sig,
info_signal_proc))
| ^
../../info/signals.c:254:9: note: in expansion of macro 'set_termsig'
254 | set_termsig (sig, old_signal_handler);
| ^~~~~~~~~~~
../../info/signals.c:110:16: note: 'signal_info' declared here
110 | typedef void (*signal_info) ();
| ^~~~~~~~~~~
D:/a/_temp/msys64/mingw64/include/signal.h:43:32: note: '__p_sig_fn_t' declared
here
43 | typedef void (__cdecl *__p_sig_fn_t)(int);
| ^~~~~~~~~~~~
../../info/signals.c: At top level:
../../info/signals.c:117:20: warning: 'old_QUIT' defined but not used
[-Wunused-variable]
117 | static signal_info old_QUIT;
| ^~~~~~~~
../../info/signals.c:116:50: warning: 'old_USR1' defined but not used
[-Wunused-variable]
116 | static signal_info old_WINCH, old_INT, old_TERM, old_USR1;
| ^~~~~~~~
../../info/signals.c:116:20: warning: 'old_WINCH' defined but not used
[-Wunused-variable]
116 | static signal_info old_WINCH, old_INT, old_TERM, old_USR1;
| ^~~~~~~~~
../../info/signals.c:115:40: warning: 'old_TTIN' defined but not used
[-Wunused-variable]
115 | static signal_info old_TSTP, old_TTOU, old_TTIN;
| ^~~~~~~~
../../info/signals.c:115:30: warning: 'old_TTOU' defined but not used
[-Wunused-variable]
115 | static signal_info old_TSTP, old_TTOU, old_TTIN;
| ^~~~~~~~
../../info/signals.c:115:20: warning: 'old_TSTP' defined but not used
[-Wunused-variable]
115 | static signal_info old_TSTP, old_TTOU, old_TTIN;
| ^~~~~~~~
make[3]: *** [Makefile:2465: signals.o] Error 1
--------------------------------------------------------------------------------
The problem is that this version of gcc now assumes ISO C23, where an empty
parameter list in a declaration means "no parameter", not "an unspecified
number of parameters" any more. ISO C23 pushes us towards specifying the
parameter types. Done through the first attached patch.
With this patch applied, the compilation goes further. I then get this
compilation error:
--------------------------------------------------------------------------------
gcc -DHAVE_CONFIG_H -I. -I../../../tta/C -I.. -I../../../tta/C/parsetexi
-I../../../tta/C/convert -I../../../tta/C/main
-I../../../tta/C/structuring_transfo -I../../../tta/C
-DDATADIR=\"/mingw64/share\" -DSYSCONFDIR=\"/mingw64/etc\"
-I../../../tta/gnulib/lib -I../gnulib/lib -Wall -I/mingw64/include -g -O2 -MT
texistatic-texi2any.o -MD -MP -MF .deps/texistatic-texi2any.Tpo -c -o
texistatic-texi2any.o `test -f 'texi2any.c' || echo '../../../tta/C/'`texi2any.c
...
../../../tta/C/texi2any.c: In function 'main':
../../../tta/C/texi2any.c:3946:25: error: passing argument 2 of '_execvp' from
incompatible pointer type [-Wincompatible-pointer-types]
3946 | execvp (texi2dvi, argv);
| ^~~~
| |
| char **
In file included from D:/a/_temp/msys64/mingw64/include/unistd.h:11,
from ../gnulib/lib/unistd.h:40,
from ../gnulib/lib/time.h:51,
from ../gnulib/lib/sys/stat.h:51,
from ../gnulib/lib/fcntl.h:71,
from ../../../tta/C/main/system.h:24,
from ../../../tta/C/texi2any.c:21:
D:/a/_temp/msys64/mingw64/include/process.h:72:77: note: expected 'const char *
const*' but argument is of type 'char **'
72 | _CRTIMP intptr_t __cdecl _execvp(const char *_Filename,const char
*const *_ArgList);
|
~~~~~~~~~~~~~~~~~~~^~~~~~~~
../../../tta/C/texi2any.c:1167:15: warning: unused variable
'langinfo_locale_encoding' [-Wunused-variable]
1167 | const char *langinfo_locale_encoding;
| ^~~~~~~~~~~~~~~~~~~~~~~~
make[5]: *** [Makefile:6807: texistatic-texi2any.o] Error 1
--------------------------------------------------------------------------------
Here the cause is that execvp() in POSIX has a wrong prototype (lacks 'const'),
and the Microsoft Windows _execvp() has it right. This is fixed through the
second attached patch.
Bruno
>From 411a4844b0b3226531a40de77d961f2e41548959 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 6 Sep 2026 07:43:46 +0200
Subject: [PATCH 1/2] info: Fix compilation error on mingw with an ISO C23
compiler.
* info/signals.c (signal_info): Define as a function that takes an 'int'
parameter.
---
info/signals.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/info/signals.c b/info/signals.c
index cb6a5670ac..b3200bbe8f 100644
--- a/info/signals.c
+++ b/info/signals.c
@@ -107,7 +107,7 @@ restore_termsig (int sig, const signal_info *saved)
sigaction (sig, saved, NULL);
}
#else /* !HAVE_SIGACTION */
-typedef void (*signal_info) ();
+typedef void (*signal_info) (int);
#define set_termsig(sig, old) (void)(*(old) = signal (sig, info_signal_proc))
#define restore_termsig(sig, saved) (void)signal (sig, *(saved))
#endif /* !HAVE_SIGACTION */
--
2.53.0
>From 7d509427d10d0eec47512a2e5fca2926142f7e3b Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 6 Sep 2026 12:15:58 +0200
Subject: [PATCH 2/2] tta: Fix compilation error on mingw with an ISO C23
compiler.
* tta/C/texi2any.c (EXEC_CONST): New macro.
(main): Use it for argv.
---
tta/C/texi2any.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tta/C/texi2any.c b/tta/C/texi2any.c
index be8f9f30b6..bccb7314d8 100644
--- a/tta/C/texi2any.c
+++ b/tta/C/texi2any.c
@@ -113,6 +113,14 @@
# define PATH_SEP ":"
#endif /* not O_BINARY */
+/* for dealing with differences between execvp() (POSIX) and
+ _execvp() (Windows) */
+#ifdef _WIN32
+# define EXEC_CONST const
+#else
+# define EXEC_CONST
+#endif
+
static const char *conf_file_name = "texi2any-config.pm";
typedef struct FORMAT_COMMAND_LINE_NAME {
@@ -3927,7 +3935,7 @@ main (int argc, char *argv[], char *env[])
if (call_texi2dvi && texi2dvi)
{
- char **argv;
+ EXEC_CONST char **argv;
size_t i;
if (debug)
@@ -3936,7 +3944,9 @@ main (int argc, char *argv[], char *env[])
fprintf (stderr, "EXEC %s\n", texi2dvi_call);
free (texi2dvi_call);
}
- argv = (char **) malloc ((texi2dvi_args.number +1) * sizeof (char *));
+ argv
+ = (EXEC_CONST char **)
+ malloc ((texi2dvi_args.number + 1) * sizeof (EXEC_CONST char *));
for (i = 0; i < texi2dvi_args.number; i++)
argv[i] = strdup (texi2dvi_args.list[i]);
argv[texi2dvi_args.number] = NULL;
--
2.53.0