summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-05-25 14:34:13 +0200
committerJim Meyering <meyering@redhat.com>2011-05-26 22:13:54 +0200
commitad756440fbf29fa35fd5c1c0893a3e96fe60aa54 (patch)
tree691f313a57415594460c0458b75f9ea268f8ee52
parent419b6c9d42ba643265f802cd150d0b232e43186a (diff)
downloadcoreutils-ad756440fbf29fa35fd5c1c0893a3e96fe60aa54.tar.xz
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.
-rw-r--r--configure.ac8
1 files changed, 6 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index c8bd9e3b3..3dbce5d80 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"