Control: tags -1 + patch On Fri, Feb 21, 2025 at 08:13:13PM +0100, Agustin Martin wrote: > On Thu, Feb 20, 2025 at 10:43:09AM +0100, Agustin Martin wrote: > > On Mon, Feb 17, 2025 at 05:50:15PM +0000, Matthias Klose wrote: > > > Package: src:regina-rexx > > > Version: 3.9.5+dfsg1-0.1 > > > Severity: important > > > Tags: sid forky > > > User: [email protected] > > > Usertags: ftbfs-gcc-15 > > ... > > > To build with GCC 15, either set CC=gcc-15 CXX=g++-15 explicitly, > > > or install the gcc, g++, gfortran, ... packages from experimental. > > > > > > apt-get -t=experimental install g++ > > > > Checked by passing -std=gnu23 to compiler.
> The problem that remains is the one I mentioned before. When gci is enabled, > some errors > of this kind are shown > > ---- > ./gci/gci_call.c: In function 'doCall': > ./gci/gci_call.c:75:8: error: too many arguments to function 'func' > 75 | ((void (*)())func)( GCI_PASSARGS( buf ) ); > | ~^~~~~~~~~~~~~~~~~ > ./gci/gci_call.c:63:33: error: too many arguments to function '(signed char > (*)(void))func' > 63 | ((type (*)())func)( GCI_PASSARGS( buf > ) ); \ > | ~^~~~~~~~~~~~~~~~~ Hi, Looks like I got what happens. Seems that there were two changes in C23 regarding variable arguments list in function definitions. On the one hand, '()' seems to mean now void and only void, and no longer a non specified variable argument list. On the other hand, plain C++ ellipsis is now accepted for that purpose, without a first explicit argument type. Attached patch tries to use ellipsis when possible, be it C++ or C (>=C23). -- Agustin
Description: '()' is not allowed for variable funcion arguments. Author: Agustin Martin Domingo <[email protected]> Forwarded: https://sourceforge.net/p/regina-rexx/bugs/612/ Bug-Debian: http://bugs.debian.org/1097785 C23 error message with gci enabled: --- ./gci/gci_call.c: In function 'doCall': ./gci/gci_call.c:75:8: error: too many arguments to function '(void (*)(void))func' 75 | ((void (*)())func)( GCI_PASSARGS( buf ) ); | ~^~~~~~~~~~~~~~~~~ ./gci/gci_call.c:63:33: error: too many arguments to function '(signed char (*)(void))func' 63 | ((type (*)())func)( GCI_PASSARGS( buf ) ); \ | ~^~~~~~~~~~~~~~~~~ --- Seems that there were two changes in C23 regarding variable arguments list in function definitions. On the one hand, '()' seems to mean now void and only void, and no longer a non specified variable argument list. On the other hand, plain C++ ellipsis is now accepted for that purpose, without a first explicit argument type. This patch tries to use ellipsis when possible, be it C++ or C (>=C23). --- a/gci/gci_call.c +++ b/gci/gci_call.c @@ -37,6 +37,10 @@ static void *returnValue; +#if defined __cplusplus || ( __STDC_VERSION__ >= 202000 ) +# define USE_CXX_VA_ELLIPSIS 1 +#endif + GCI_JUMPVAR(safetyRope) /* @@ -53,7 +57,7 @@ static void doCall( void (*func)(), const GCI_parseinfo *info, const GCI_STACK_ELEMENT *buf ) { -#ifdef __cplusplus +#ifdef USE_CXX_VA_ELLIPSIS # define DOCALL(type) *((type *) returnValue) = \ ((type (*)(...))func)( GCI_PASSARGS( buf ) ); \ GCI_JUMP( GCI_JUMP_GETVAR( safetyRope ), 1 ); \ @@ -69,7 +73,7 @@ static void doCall( void (*func)(), if ( info == NULL ) { -#ifdef __cplusplus +#ifdef USE_CXX_VA_ELLIPSIS ((void (*)(...))func)( GCI_PASSARGS( buf ) ); #else ((void (*)())func)( GCI_PASSARGS( buf ) );

