On 10/21/19 2:07 AM, Akim Demaille wrote:

I'd rather not. Newer compilers are doing their jobs better in this area,

I don't see that, given that I have the problem with GCC 7, 8 and 9 on macOS.

That's odd. What problems are these? GCC 9 should have the necessary primitives to bypass the code eliciting the warnings you mentioned; besides, recent GCCs are better at avoiding false alarms with options like -Wtype-limits. I don't see why macOS GCC 9 would differ from GNU/Linux GCC 9 in this area.

I just built Bison master with the attached patch (./configure --enable-gcc-warnings --disable-nls), and "make" and "make check" both succeeded on Fedora 30 with GCC 9.2.1 20190827 (Red Hat 9.2.1-1). How does such a build fail for you with macOS 9 and GCC 9.2?
diff --git a/configure.ac b/configure.ac
index f0689070..44cf7cd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,7 +103,7 @@ if test "$enable_gcc_warnings" = yes; then
   warn_common='-Wall -Wextra -Wcast-align
     -fparse-all-comments -Wdocumentation
     -Wformat -Wimplicit-fallthrough -Wnull-dereference
-    -Wno-sign-compare -Wno-tautological-constant-out-of-range-compare -Wno-type-limits
+    -Wno-sign-compare -Wno-tautological-constant-out-of-range-compare
     -Wpointer-arith -Wshadow
     -Wwrite-strings'
   warn_c='-Wbad-function-cast -Wstrict-prototypes'
@@ -119,7 +119,7 @@ if test "$enable_gcc_warnings" = yes; then
   # details for lalr1.cc.
   warn_tests='-Wundef -pedantic -Wconversion
     -Wdeprecated -Wsign-compare -Wsign-conversion
-    -Wtautological-constant-out-of-range-compare -Wtype-limits
+    -Wtautological-constant-out-of-range-compare
     -fno-color-diagnostics
     -Wno-keyword-macro'
 

Reply via email to