build: reenable -Wtype-limits

See https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00061.html
to https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00073.html.

Paul Eggert's changes in gnulib do fix the issue for modern GCCs (7,
8, 9) on macOS.  Unfortunately these warnings are back on the
CI (GNU/Linux) with GCC 4.6, 4.7, (not 4.8) and 4.9.

Disable the warning locally.

* configure.ac (warn_common, warn_tests): Remove -Wtype-limits.
* src/system.h (IGNORE_TYPE_LIMITS_BEGIN, IGNORE_TYPE_LIMITS_END): New.
* src/InadequacyList.c, src/parse-gram.c, src/parse-gram.y,
* src/symtab.c: Use it.
This commit is contained in:
Akim Demaille
2019-10-23 23:10:11 +02:00
parent bc5efb558d
commit 76597d01f3
6 changed files with 25 additions and 6 deletions

View File

@@ -74,6 +74,20 @@ typedef size_t uintptr_t;
# include <xalloc.h>
/* See https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00061.html. */
#if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ < 5
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define IGNORE_TYPE_LIMITS_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wtype-limits\"")
# define IGNORE_TYPE_LIMITS_END \
_Pragma ("GCC diagnostic pop")
#else
# define IGNORE_TYPE_LIMITS_BEGIN
# define IGNORE_TYPE_LIMITS_END
#endif
/*-----------------.
| GCC extensions. |
`-----------------*/