From 96101eef33b2a56bd169560cd806b4b3237d2430 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 12 Aug 2017 13:51:19 -0700 Subject: [PATCH] build: adjust warning options to work with latest GCC * configure.ac: Disable some new warnings to avoid false positives. Building with warnings enabled and latest gcc would evoke build failure without these changes. Disable the following in coreutils proper: -Wformat-overflow=2 -Wformat-truncation=2, and disable these for gnulib: -Wformat-truncation=2 -Wduplicated-branches --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 7c7c8c2382..73e445d02a 100644 --- a/configure.ac +++ b/configure.ac @@ -133,6 +133,8 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Wswitch-default" # Too many warnings for now nw="$nw -Wstack-protector" # not worth working around nw="$nw -Wtype-limits" # False alarms for portable code + nw="$nw -Wformat-overflow=2" # False alarms due to GCC bug 80776 + nw="$nw -Wformat-truncation=2" # False alarm in ls.c, probably related # things I might fix soon: nw="$nw -Wfloat-equal" # sort.c, seq.c nw="$nw -Wmissing-format-attribute" # copy.c @@ -193,6 +195,8 @@ 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 -Wduplicated-branches" # Too many false alarms + nw="$nw -Wformat-truncation=2" nw="$nw -Wstrict-overflow" nw="$nw -Wuninitialized" nw="$nw -Wunused-macros" -- 2.47.2