Description: nullptr is a reserved word in C23. Use mynullptr instead. Author: Agustin Martin Domingo Forwarded: https://sourceforge.net/p/regina-rexx/bugs/612/ Bug-Debian: http://bugs.debian.org/1097785 C23 error message: --- x86_64-linux-gnu-gcc ... ./variable.c ./variable.c: In function ‘assign_foliage’: ./variable.c:1497:12: error: expected identifier or ‘(’ before ‘nullptr’ 1497 | streng *nullptr = NULL; /* allow REPLACE_VALUE macro to pass NULL value under C++ */ | ^~~~~~~ make[1]: *** [Makefile:423: variable.o] Error 1 --- Seems that nullptr has become a reserved word in C23. Renaming internal nullptr to something else should fix this. This patch uses mynullptr. --- a/variable.c +++ b/variable.c @@ -1494,7 +1494,7 @@ static void assign_foliage( const tsd_t unsigned i; streng *copy; variableptr ptr, tptr, *queue, real; - streng *nullptr = NULL; /* allow REPLACE_VALUE macro to pass NULL value under C++ */ + streng *mynullptr = NULL; /* allow REPLACE_VALUE macro to pass NULL value under C++ */ DPRINTF((TSD,"assign_foliage: ?")); @@ -1532,7 +1532,7 @@ static void assign_foliage( const tsd_t } else if ( real->value ) { - REPLACE_VALUE( nullptr, real ); + REPLACE_VALUE( mynullptr, real ); DSTART;DPRINT((TSD," "));DVAR(TSD,"real(now)",real);DEND; } --- a/yaccsrc.y +++ b/yaccsrc.y @@ -66,7 +66,7 @@ static int parendepth; static nodeptr current, with = NULL; -static char *nullptr = NULL; /* for C++ compilation */ +static char *mynullptr = NULL; /* for C++ compilation */ typedef enum { IS_UNKNOWN, IS_A_NUMBER, @@ -1285,9 +1285,9 @@ expr : '(' { | STRING { $$ = makenode( X_STRING, 0 ); $$->name = Str_cre_TSD(parser_data.TSD,retvalue) ; } | function { $$ = $1 ; } - | '+' expr %prec UPLUS { AUTO_REDUCE( $2, nullptr ); + | '+' expr %prec UPLUS { AUTO_REDUCE( $2, mynullptr ); $$ = makenode( X_U_PLUSS, 1, $2 ); } - | '-' expr %prec UMINUS { AUTO_REDUCE( $2, nullptr ); + | '-' expr %prec UMINUS { AUTO_REDUCE( $2, mynullptr ); $$ = makenode( X_U_MINUS, 1, $2 ); } | '+' error { exiterror( ERR_INVALID_EXPRESSION, 1, __reginatext ); } /* fixes bug 1107760 */ | '-' error { exiterror( ERR_INVALID_EXPRESSION, 1, __reginatext ); } /* fixes bug 1107760 */ --- a/yaccsrc.c +++ b/yaccsrc.c @@ -139,7 +139,7 @@ static int parendepth; static nodeptr current, with = NULL; -static char *nullptr = NULL; /* for C++ compilation */ +static char *mynullptr = NULL; /* for C++ compilation */ typedef enum { IS_UNKNOWN, IS_A_NUMBER, @@ -199,7 +199,7 @@ static void move_labels( nodeptr front, # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# define YY_NULLPTR mynullptr # else # define YY_NULLPTR 0 # endif @@ -4941,14 +4941,14 @@ yyreduce: case 434: #line 1288 "../yaccsrc.y" /* yacc.c:1646 */ - { AUTO_REDUCE( (yyvsp[0]), nullptr ); + { AUTO_REDUCE( (yyvsp[0]), mynullptr ); (yyval) = makenode( X_U_PLUSS, 1, (yyvsp[0]) ); } #line 4947 "../yaccsrc.c" /* yacc.c:1646 */ break; case 435: #line 1290 "../yaccsrc.y" /* yacc.c:1646 */ - { AUTO_REDUCE( (yyvsp[0]), nullptr ); + { AUTO_REDUCE( (yyvsp[0]), mynullptr ); (yyval) = makenode( X_U_MINUS, 1, (yyvsp[0]) ); } #line 4954 "../yaccsrc.c" /* yacc.c:1646 */ break;