> Date: Mon, 07 Sep 2026 14:19:43 +0200
> From: Bruno Haible via Bug reports for the GNU Texinfo documentation system
>  <[email protected]>
> 
> 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.

Thanks, these are obviously okay.

  • two ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
    • ... Eli Zaretskii
      • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
        • ... Gavin Smith

Reply via email to