On 10/17/19 11:34 PM, Akim Demaille wrote:
Bison no longer compiles cleanly (i.e., many warnings) on macOS with GCC 7, 8,
9. Clang is ok though. And there are similar failures on the CI with older
versions of GCC.
https://travis-ci.org/akimd/bison/builds/599470491
First, I suggest telling Travis not to use --enable-gcc-warnings. That
option is intended mainly for developers, and it's not suitable for
simply building and testing Bison because it generates too many false
alarms (as is the case here).
Second, the diagnostics in the above URL are all false alarms. If they
are affecting you, does the attached patch silence them? This patch is
the sort of thing we do for other GNU projects (e.g., coreutils, Emacs),
because back when we were configuring these warning options the latest
GCC (the one used by developers) generated too many false alarms.
-Wno-type-limits doesn't seem to be needed with recent GCC so I suppose
they fixed some GCC bugs in this area.
>From c8e16e3517f8636e892bbab6ce7ff9373a8be90b Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Fri, 18 Oct 2019 11:40:05 -0700
Subject: [PATCH] port to picky older GCC
Older GCC and Clang generate bogus -Wtype-limits diagnostics.
Problem reported by Akim Demaille in:
https://lists.gnu.org/r/bug-bison/2019-10/msg00061.html
* configure.ac (warn_common): Add -Wno-type-limits.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 0c1efde1..412574f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,7 +96,7 @@ AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes])
if test "$enable_gcc_warnings" = yes; then
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
-fparse-all-comments -Wdocumentation
- -Wformat -Wimplicit-fallthrough -Wnull-dereference
+ -Wformat -Wimplicit-fallthrough -Wno-type-limits -Wnull-dereference
-Wpointer-arith -Wshadow
-Wwrite-strings'
warn_c='-Wbad-function-cast -Wstrict-prototypes'
--
2.14.2