]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: adjust warning options to work with latest GCC
authorJim Meyering <meyering@fb.com>
Sat, 12 Aug 2017 20:51:19 +0000 (13:51 -0700)
committerJim Meyering <meyering@fb.com>
Sat, 12 Aug 2017 20:51:19 +0000 (13:51 -0700)
* 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

index 7c7c8c23829220d0459f44b12a43de61639a7a5e..73e445d02ad072d9672d962a8757799998fcfabe 100644 (file)
@@ -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"