Description: '()' is not allowed for variable function arguments. Author: Agustin Martin Domingo 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 ) );