summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-11-30 09:23:35 +0100
committerAkim Demaille <akim.demaille@gmail.com>2019-12-06 08:27:55 +0100
commitf8d82ff03900c109efb57634299d7d180ce60987 (patch)
tree2b3a125b22ed6faa1e3823f10420092587fc95d3 /tests
parent9e9e49224fb4a7fae7b98205e1165fbfcea2453f (diff)
downloadbison-f8d82ff03900c109efb57634299d7d180ce60987.tar.gz
warnings: enable -Wuseless-cast, and eliminate warnings
Prompted by Frank Heckenbach. https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html. * configure.ac (warn_cxx): Add -Wuseless-cast. * data/skeletons/c.m4 (b4_attribute_define): Define YY_IGNORE_USELESS_CAST_BEGIN and YY_IGNORE_USELESS_CAST_END. * data/skeletons/glr.c (YY_FPRINTF): New, replaces YYFPRINTF, wrapped with YY_IGNORE_USELESS_CAST_BEGIN and YY_IGNORE_USELESS_CAST_END. (YY_DPRINTF): Likewise. * tests/actions.at: Remove useless cast. * tests/headers.at: Adjust.
Diffstat (limited to 'tests')
-rw-r--r--tests/actions.at4
-rw-r--r--tests/headers.at2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/actions.at b/tests/actions.at
index c702373c..e22e2596 100644
--- a/tests/actions.at
+++ b/tests/actions.at
@@ -1780,7 +1780,7 @@ float: UNTYPED INT
yy::parser::token::INT,
EOF}]],
[[{UNTYPED, INT, EOF}]]),
- [AT_VAL.ival = YY_CAST (int, toknum) * 10;
+ [AT_VAL.ival = toknum * 10;
AT_VAL.fval = YY_CAST (float, toknum) / 10.0f;])[
]AT_MAIN_DEFINE[
]])
@@ -1897,7 +1897,7 @@ exp:
%%
]AT_YYERROR_DEFINE[
-]AT_YYLEX_DEFINE(["bcd"], [*lvalp = YY_CAST (int, (toknum + 1) * 10)])[
+]AT_YYLEX_DEFINE(["bcd"], [*lvalp = (toknum + 1) * 10])[
]AT_MAIN_DEFINE[
]])
AT_BISON_OPTION_POPDEFS
diff --git a/tests/headers.at b/tests/headers.at
index 079fd9f9..31427436 100644
--- a/tests/headers.at
+++ b/tests/headers.at
@@ -326,7 +326,7 @@ AT_PERL_CHECK([[-n -0777 -e '
|YY_CONSTEXPR
|YY_COPY
|YY_CPLUSPLUS
- |YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
+ |YY_IGNORE_(?:MAYBE_UNINITIALIZED|USELESS_CAST)_(?:BEGIN|END)
|YY_INITIAL_VALUE
|YY_MOVE
|YY_MOVE_OR_COPY