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.
This commit is contained in:
Akim Demaille
2019-11-30 09:23:35 +01:00
parent 9e9e49224f
commit f8d82ff039
7 changed files with 153 additions and 100 deletions

12
TODO
View File

@@ -1,4 +1,16 @@
* Bison 3.5
** Deprecate YYPRINT
The doc shows it too much.
** glr.c: parse.assert
There are many assertions in glr.c that are there to check the skeleton
itself, not the user code. So it should be under the control of
parse.assert.
** java, d: error.verbose
The code checks dynamically for error.verbose. It should be controlled by
M4.
** doc
I feel its ugly to use the GNU style to declare functions in the doc. It
generates tons of white space in the page, and may contribute to bad page