]> Savannah Git Hosting - gnulib.git/commitdiff
manywarnings: add GCC 4.9 warnings
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Sep 2014 08:51:06 +0000 (01:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Sep 2014 08:51:37 +0000 (01:51 -0700)
Also, make it easier to maintain this in the future.
* build-aux/gcc-warning.spec: Add -Wabi-tag,
-Wconditionally-supported, -Wdelete-incomplete,
-Winherited-variadic-ctor, -Wvirtual-move-assign, -Wzerotrip.
Remove duplicates.  Use tabs uniformly, as that's what 'cut' wants.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wdate-time,
-Wopenmp-simd.  Use -fdiagnostics-show-option and -funit-at-a-time
only for older GCC versions that need them.  Handke
-Wnormalized=nfc specially, so that the 'comm' command used
for maintenance doesn't get confused.

ChangeLog
build-aux/gcc-warning.spec
m4/manywarnings.m4

index 386673b27c476f9821444da665f939783594db79..ac039fb6ff6fa6326e2ca430c37e4cdc05ba631c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2014-09-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       manywarnings: add GCC 4.9 warnings
+       Also, make it easier to maintain this in the future.
+       * build-aux/gcc-warning.spec: Add -Wabi-tag,
+       -Wconditionally-supported, -Wdelete-incomplete,
+       -Winherited-variadic-ctor, -Wvirtual-move-assign, -Wzerotrip.
+       Remove duplicates.  Use tabs uniformly, as that's what 'cut' wants.
+       * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wdate-time,
+       -Wopenmp-simd.  Use -fdiagnostics-show-option and -funit-at-a-time
+       only for older GCC versions that need them.  Handke
+       -Wnormalized=nfc specially, so that the 'comm' command used
+       for maintenance doesn't get confused.
+
 2014-08-31  Paul Eggert  <eggert@cs.ucla.edu>
 
        vasnprintf: fix bugs in width computation
index 74c6503b9b0d4e76d37d6da216d574b1ce5b8b21..1c250dcb46b537d0880cfd3b531560e4f2c193e8 100644 (file)
@@ -1,6 +1,7 @@
 # options to filter out, and why
 --all-warnings                         alias for -Wall
 --extra-warnings                       alias for -Wextra
+-Wabi-tag                              c++
 -Waggregate-return                     obsolescent
 -Waliasing                             fortran
 -Walign-commons                                fortran
 -Wc++0x-compat                         c++
 -Wc++11-compat                         c++
 -Wc-binding-type                       fortran
--Wc-binding-type                        fortran
 -Wcast-qual                            FIXME maybe? too much noise; encourages bad changes
 -Wcharacter-truncation                 fortran
--Wcompare-reals                         fortran
+-Wcompare-reals                                fortran
+-Wconditionally-supported              c++ and objc++
 -Wconversion                           FIXME maybe? too much noise; encourages bad changes
 -Wconversion-extra                     fortran
 -Wconversion-null                      c++ and objc++
 -Wctor-dtor-privacy                    c++
 -Wdeclaration-after-statement          FIXME: do not want.  others may
--Wdeclaration-after-statement           obsolescent
+-Wdelete-incomplete                    c++ and objc++
 -Wdelete-non-virtual-dtor              c++
 -Weffc++                               c++
 -Werror-implicit-function-declaration  deprecated
@@ -30,6 +31,7 @@
 -Wfunction-elimination                 fortran
 -Wimplicit-interface                   fortran
 -Wimplicit-procedure                   fortran
+-Winherited-variadic-ctor              c++
 -Wintrinsic-shadow                     fortran
 -Wintrinsics-std                       fortran
 -Winvalid-offsetof                     c++ and objc++
@@ -37,7 +39,6 @@
 -Wlarger-than=<number>                 FIXME: choose something sane?
 -Wline-truncation                      fortran
 -Wliteral-suffix                       c++ and objc++
--Wliteral-suffix                        c++ and objc++
 -Wlong-long                            obsolescent
 -Wnoexcept                             c++
 -Wnon-template-friend                  c++
 -Wnormalized=<id|nfc|nfkc>             FIXME: choose something sane?
 -Wold-style-cast                       c++ and objc++
 -Woverloaded-virtual                   c++
--Wpadded                               FIXME: dunno
--Wpadded                                FIXME maybe?  warns about "stabil" member in /usr/include/bits/timex.h
+-Wpadded                               FIXME maybe?  warns about "stabil" member in /usr/include/bits/timex.h
 -Wpedantic                             FIXME: too strict?
 -Wpmf-conversions                      c++ and objc++
 -Wproperty-assign-default              objc++
 -Wprotocol                             objc++
 -Wreal-q-constant                      fortran
 -Wrealloc-lhs                          fortran
--Wrealloc-lhs                           fortran
 -Wrealloc-lhs-all                      fortran
--Wrealloc-lhs-all                       fortran
 -Wredundant-decls                      FIXME maybe? many _gl_cxxalias_dummy FPs
 -Wreorder                              c++ and objc++
 -Wselector                             objc and objc++
 -Wswitch-enum                          FIXME maybe? borderline.  some will want this
 -Wsynth                                        deprecated
 -Wtabs                                 fortran
--Wtarget-lifetime                       fortran
+-Wtarget-lifetime                      fortran
 -Wtraditional                          obsolescent
 -Wtraditional-conversion               obsolescent
 -Wundeclared-selector                  objc and objc++
 -Wundef                                        FIXME maybe? too many false positives
 -Wunderflow                            fortran
--Wunsuffixed-float-constants            triggers warning in gnulib's timespec.h
+-Wunsuffixed-float-constants           triggers warning in gnulib's timespec.h
 -Wunused-dummy-argument                        fortran
 -Wuseless-cast                         c++ and objc++
--Wuseless-cast                          c++ and objc++
+-Wvirtual-move-assign                  c++
 -Wzero-as-null-pointer-constant                c++ and objc++
+-Wzerotrip                             fortran
 -frequire-return-statement             go
index e1cee6cf9d1105e17db161c1f5da4303be18ba9b..3e6dd215ced4b4cec993d84d60f428da4fe3205b 100644 (file)
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 6
+# manywarnings.m4 serial 7
 dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -93,6 +93,14 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
   fi
 
   # List all gcc warning categories.
+  # To compare this list to your installed GCC's, run this Bash command:
+  #
+  # comm -3 \
+  #  <(sed -n 's/^  *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
+  #  <(gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort |
+  #      grep -v -x -f <(
+  #         awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
+
   gl_manywarn_set=
   for gl_manywarn_item in \
     -W \
@@ -111,6 +119,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wcomments \
     -Wcoverage-mismatch \
     -Wcpp \
+    -Wdate-time \
     -Wdeprecated \
     -Wdeprecated-declarations \
     -Wdisabled-optimization \
@@ -150,9 +159,9 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wnarrowing \
     -Wnested-externs \
     -Wnonnull \
-    -Wnormalized=nfc \
     -Wold-style-declaration \
     -Wold-style-definition \
+    -Wopenmp-simd \
     -Woverflow \
     -Woverlength-strings \
     -Woverride-init \
@@ -203,13 +212,26 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wvla \
     -Wvolatile-register-var \
     -Wwrite-strings \
-    -fdiagnostics-show-option \
-    -funit-at-a-time \
     \
     ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
   done
 
+  # gcc --help=warnings outputs an unusual form for this option; list
+  # it here so that the above 'comm' command doesn't report a false match.
+  gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
+
+  # These are needed for older GCC versions.
+  if test -n "$GCC"; then
+    case `($CC --version) 2>/dev/null` in
+      'gcc (GCC) '[[0-3]].* | \
+      'gcc (GCC) '4.[[0-7]].*)
+        gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
+        gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
+          ;;
+    esac
+  fi
+
   # Disable specific options as needed.
   if test "$gl_cv_cc_nomfi_needed" = yes; then
     gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"