From: Jim Meyering Date: Wed, 25 May 2011 12:34:13 +0000 (+0200) Subject: build: --enable-gcc-warnings: enable -Wstrict-overflow in src/ X-Git-Tag: v8.13~141 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad756440fbf29fa35fd5c1c0893a3e96fe60aa54;p=platform%2Fupstream%2Fcoreutils.git build: --enable-gcc-warnings: enable -Wstrict-overflow in src/ * configure.ac (WARN_CFLAGS): Don't turn off -Wstrict-overflow. (GNULIB_WARN_CFLAGS): Remove -Wstrict-overflow from the list of warning options used in lib/. Normally I find that -Wstrict-overflow produces too many false positives, but considering that it warns of the bug reported in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498, I now think it is worthwhile. The lesser of two evils. Thanks to Daniel Veillard for showing me the gcc bug report. --- diff --git a/configure.ac b/configure.ac index c8bd9e3..3dbce5d 100644 --- a/configure.ac +++ b/configure.ac @@ -88,8 +88,11 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Wmissing-format-attribute" # copy.c nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot - nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c - # ?? -Wstrict-overflow + + # Using -Wstrict-overflow is a pain, but the alternative is worse. + # For an example, see the code that provoked this report: + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498 + # Code like that still infloops with gcc-4.6.0 and -O2. Scary indeed. gl_MANYWARN_ALL_GCC([ws]) gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) @@ -116,6 +119,7 @@ if test "$gl_gcc_warnings" = yes; then # We use a slightly smaller set of warning options for lib/. # Remove the following and save the result in GNULIB_WARN_CFLAGS. nw= + nw="$nw -Wstrict-overflow" nw="$nw -Wuninitialized" nw="$nw -Wunused-macros" nw="$nw -Wmissing-prototypes"