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 d87c8ac79a
and 9645a2b20e.

* tests/headers.at (Several parsers, Several parsers): Disable these
warnings when in push parser.
This commit is contained in:
Akim Demaille
2019-10-20 13:55:36 +02:00
parent 4e0de4df8c
commit 41b1f828ae

View File

@@ -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
]])[