tests: disable GCC7 warnings for some tests

With GCC7 we have warnings (false positive):

    x8.c: In function 'x8_parse':
    x8.c:1233:16: error: 'yylval' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             yylval = *yypushed_val;
             ~~~~~~~^~~~~~~~~~~~~~~
    x8.c: In function 'x8_pull_parse':
    x8.c:1233:16: error: 'yylval' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             yylval = *yypushed_val;
             ~~~~~~~^~~~~~~~~~~~~~~

See also 9645a2b20e.

* tests/local.at (AT_PUSH_IF): New.
(AT_BISON_OPTION_POPDEFS): Pop it, and pop AT_PURE_IF.
* tests/headers.at (Several parsers, Several parsers): Disable these
warnings when in push parser.
This commit is contained in:
Akim Demaille
2018-09-02 18:15:55 +02:00
parent a7e46f6e41
commit d87c8ac79a
2 changed files with 16 additions and 4 deletions

View File

@@ -111,8 +111,8 @@ AT_CLEANUP
## Sane headers. ##
## -------------- ##
# AT_TEST([DIRECTIVES])
# ---------------------
# AT_TEST([DIRECTIVES], [COMPILER-FLAGS])
# ---------------------------------------
# Check that headers are self-contained and protected againt multiple
# inclusions.
@@ -125,7 +125,11 @@ AT_DATA_GRAMMAR([input.y],
%error-verbose
]AT_VARIANT_IF([], [%union {int integer;}])[
%code {
#include <stdio.h>
]AT_PUSH_IF([[
#if defined __GNUC__ && 7 == __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
]])[
]AT_YYERROR_DECLARE[
]AT_YYLEX_DECLARE[
}
@@ -206,7 +210,11 @@ $2
int integer;
}
%{
#include <stdio.h>
]AT_PUSH_IF([[
#if defined __GNUC__ && 7 == __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
]])[
]AT_YYERROR_DECLARE[
]AT_YYLEX_DECLARE[
%}