-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
The reason is
Lines 2008 to 2009 in 25b3d0e
yypcontext_t yyctx | |
= {]b4_push_if([[yyps]], [[yyssp]b4_lac_if([[, yyesa, &yyes, &yyes_capacity]])])[, yytoken]b4_locations_if([[, &yylloc]])[}; |
which leads to a generation of
yypcontext_t yyctx
= {yyssp, yytoken};
char const *yymsgp = YY_("syntax error");
int yysyntax_error_status;
yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
and therefore raises
parser.c:24521:14: warning: initializer element is not computable at load time [-Wpedantic]
24521 | = {yyssp, yytoken};
| ^~~~~
parser.c:24521:21: warning: initializer element is not computable at load time [-Wpedantic]
24521 | = {yyssp, yytoken};
| ^~~~~~~
Changing the generated code as follows:
yypcontext_t yyctx;
char const *yymsgp = YY_("syntax error");
int yysyntax_error_status;
yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
yyctx.yyssp = yyssp;
yyctx.yytoken = yytoken;
yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
fixes the code, but sadly that is not easily replaced by defining some macros.
Metadata
Metadata
Assignees
Labels
No labels