From 41b1f828ae39518d75948035c99ba053bc402752 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 20 Oct 2019 13:55:36 +0200 Subject: [PATCH] tests: beware of GCC9 warnings in push mode This is really weird: GCC points to the LHS of the assignment... 260. headers.at:184: testing Sane headers: api.pure api.push-pull=both ... tests/headers.at:184: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y tests/headers.at:184: $CC $CFLAGS $CPPFLAGS -c -o input.o input.c stderr: input.c: In function 'yyparse': input.c:1276:16: error: 'yylval' may be used uninitialized in this function [-Werror=maybe-uninitialized] 1276 | yylval = *yypushed_val; | ~~~~~~~^~~~~~~~~~~~~~~ input.c: In function 'yypull_parse': input.c:1276:16: error: 'yylval' may be used uninitialized in this function [-Werror=maybe-uninitialized] 1276 | yylval = *yypushed_val; | ~~~~~~~^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors stdout: tests/headers.at:184: exit code was 1, expected 0 See also d87c8ac79ab844d6a7a4f5103dcf7a842d18b611 and 9645a2b20ee7cbfa8bb4ac2237f87d598afe349c. * tests/headers.at (Several parsers, Several parsers): Disable these warnings when in push parser. --- tests/headers.at | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/headers.at b/tests/headers.at index 390dfa4c..11d60f16 100644 --- a/tests/headers.at +++ b/tests/headers.at @@ -129,7 +129,7 @@ AT_DATA_GRAMMAR([input.y], %code { #include /* printf. */ ]AT_PUSH_IF([[ -#if defined __GNUC__ && 7 == __GNUC__ +#if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif ]])[ @@ -215,7 +215,7 @@ $2 %{ #include /* printf. */ ]AT_PUSH_IF([[ -#if defined __GNUC__ && 7 == __GNUC__ +#if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif ]])[