From 6a4b3240cfc0065304c945abb755157aa44a3745 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Mar 2025 20:40:29 -0700 Subject: [PATCH] maint: pacify gcc 14.2 -Wmaybe-uninitialized * data/skeletons/lalr1.cc: * data/skeletons/yacc.c: Add YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN and YY_IGNORE_MAYBE_UNINITIALIZED_END to pacify GCC 14, apparently after inlining. --- data/skeletons/lalr1.cc | 2 ++ data/skeletons/yacc.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc index 4242b992..464a23b8 100644 --- a/data/skeletons/lalr1.cc +++ b/data/skeletons/lalr1.cc @@ -986,6 +986,7 @@ b4_dollar_popdef])[]dnl yyreduce: yylen = yyr2_[yyn]; { + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN stack_symbol_type yylhs; yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([[ /* Variants are always initialized to an empty instance of the @@ -1038,6 +1039,7 @@ b4_dollar_popdef])[]dnl // Shift the result of the reduction. yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + YY_IGNORE_MAYBE_UNINITIALIZED_END } goto yynewstate; diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c index 07a523b0..8b377475 100644 --- a/data/skeletons/yacc.c +++ b/data/skeletons/yacc.c @@ -1531,9 +1531,11 @@ yypull_parse (yypstate *yyps]b4_user_formals[) YYLTYPE yylloc = yyloc_default;]])])[ int yystatus; do { -]b4_pure_if([[ YYSTYPE yylval; +]b4_pure_if([[ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYSTYPE yylval; int ]])[yychar = ]b4_yylex[; - yystatus = yypush_parse (yyps]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[); + yystatus = yypush_parse (yyps]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[);]b4_pure_if([[ + YY_IGNORE_MAYBE_UNINITIALIZED_END]])[ } while (yystatus == YYPUSH_MORE); return yystatus; }]])[