[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yacc: beware of GCC9 warnings in push mode
From: |
Akim Demaille |
Subject: |
Re: yacc: beware of GCC9 warnings in push mode |
Date: |
Mon, 21 Oct 2019 07:50:15 +0200 |
> commit c30c6b651973da07f3b28f23c3e4ff5f69f32082
> Author: Akim Demaille <address@hidden>
> Date: Sun Oct 20 13:55:36 2019 +0200
>
> yacc: beware of GCC9 warnings in push mode
I'm not going to push this. I had not read the warning carefully enough:
1. I'm not fixing the right code
2. Woot? It complains about the LHS of the assignment. I don't get it.
But we already addressed the exact same issue with GCC7 (not GCC8 though).
So I installed this instead.
commit 41b1f828ae39518d75948035c99ba053bc402752
Author: Akim Demaille <address@hidden>
Date: Sun Oct 20 13:55:36 2019 +0200
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.
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 <stdio.h> /* 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 <stdio.h> /* printf. */
]AT_PUSH_IF([[
-#if defined __GNUC__ && 7 == __GNUC__
+#if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__)
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
]])[