Jim Meyering wrote:
The attached patch reenables those that do not elicit a warning
from gcc-4.9.

Thanks, with an unusual configuration I ran into another warning from GCC 4.9.0 and installed the attached followup patch.

From f72c43c606b219204004ccdb327c7320f9106ce7 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Thu, 24 Apr 2014 01:10:01 -0700
Subject: [PATCH] build: suppress unsafe-loop-optimizations warnings

I ran into one of these while trying out GCC 4.9.0's new
-fsanitize=undefined option.  The warning told me that GCC didn't
do an unsafe optimization, but in 'grep' this is not typically a
symptom of a programming error.
* configure.ac (WERROR_CFLAGS): Suppress -Wunsafe-loop-optimizations.
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 6a99c40..c301ebe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,7 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wpadded"                 # Our structs are not padded
   nw="$nw -Wvla"                    # warnings in gettext.h
   nw="$nw -Wswitch-default"         # Too many warnings for now
+  nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations
   nw="$nw -Winline"                 # streq.h's streq4, streq6 and strcaseeq6
   nw="$nw -Wstrict-overflow"        # regexec.c
 
-- 
1.9.0

Reply via email to