diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2019-11-01 16:13:46 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2019-11-02 16:40:50 +0100 |
commit | 3398b0fa905b24cc7aa0fa1409f50525d645d485 (patch) | |
tree | 7a36fc5bcdcc1a421b40dedd035ad5dc0adcf9dc /doc | |
parent | 2bd1d9e20f805a121b71284c58ef2bfc5e5fd61e (diff) | |
download | bison-3398b0fa905b24cc7aa0fa1409f50525d645d485.tar.gz |
c++: fix old cast warnings
We still have a few old C casts in lalr1.cc, let's get rid of them.
Reported by Frank Heckenbach.
Actually, let's monitor all our casts using easy to grep macros.
Let's use these macros to use the C++ standard casts when we are in
C++.
* data/skeletons/c.m4 (b4_cast_define): New.
* data/skeletons/glr.c, data/skeletons/glr.cc,
* data/skeletons/lalr1.cc, data/skeletons/stack.hh,
* data/skeletons/yacc.c:
Use it and/or its casts.
* tests/actions.at, tests/cxx-type.at,
* tests/glr-regression.at, tests/headers.at, tests/torture.at,
* tests/types.at:
Use YY_CAST instead of C casts.
* configure.ac (warn_cxx): Add -Wold-style-cast.
* doc/bison.texi: Disable it.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/bison.texi | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/bison.texi b/doc/bison.texi index 1c9ed8fb..0f5838c2 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -12251,10 +12251,12 @@ then the parser's to get the set of defined tokens. # pragma GCC diagnostic ignored "-Wnull-dereference" #endif -// Of course, when compiling C as C++, expect warnings about NULL. +// This example uses Flex's C backend, yet compiles it as C++. +// So expect warnings about C style casts and NULL. #if defined __clang__ # pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" #elif defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +# pragma GCC diagnostic ignored "-Wold-style-cast" # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif |