summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-09-06 07:21:59 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-09-06 17:27:55 +0200
commit989503b1ba2f5307035239b70355dcb4361855c8 (patch)
treea79d28c8e50108a68dfd1b419c3d1bd55e2c084b /data
parent61c2c400929dbf7ee2ca42b569af5437e7edf9a3 (diff)
downloadbison-989503b1ba2f5307035239b70355dcb4361855c8.tar.gz
yacc.c: beware of GCC's -Wmaybe-uninitialized
Test 400 (calc.at:773: testing Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc) fails on the CI with GCC 8 on Bionic: 400. calc.at:773: testing Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc ... ../../tests/calc.at:773: bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y ../../tests/calc.at:773: $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS stderr: calc.y: In function 'int calcpush_parse(calcpstate*, int, const CALCSTYPE*, CALCLTYPE*)': calc.y:26:20: error: 'yylval.CALCSTYPE::ival' may be used uninitialized in this function [-Werror=maybe-uninitialized] %printer { fprintf (yyo, "%d", $$); } <ival>; ^ calc.c:1272:9: note: 'yylval.CALCSTYPE::ival' was declared here YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ^~~~~~ cc1plus: all warnings being treated as errors stdout: ../../tests/calc.at:773: exit code was 1, expected 0 400. calc.at:773: 400. Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc (calc.at:773): FAILED (calc.at:773) * data/skeletons/c.m4 (yy_symbol_value_print): Disable the warning locally.
Diffstat (limited to 'data')
-rw-r--r--data/skeletons/c.m42
1 files changed, 2 insertions, 0 deletions
diff --git a/data/skeletons/c.m4 b/data/skeletons/c.m4
index fcf58a84..27aa2939 100644
--- a/data/skeletons/c.m4
+++ b/data/skeletons/c.m4
@@ -545,7 +545,9 @@ m4_if(b4_skeleton, ["yacc.c"],
# endif
]])dnl
b4_percent_code_get([[pre-printer]])dnl
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
b4_symbol_actions([printer])
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
b4_percent_code_get([[post-printer]])dnl
[}