From df82ac05f6f308ccf07a456242dae34500ea9b9b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 24 Apr 2015 12:58:46 -0700 Subject: [PATCH] manywarnings: add GCC 5.1 warnings * build-aux/gcc-warning.spec: Add -Wabi=, -Warray-bounds, -Warray-bounds=, -Wc++14-compat, -Wc90-c99-compat, -Wc99-c11-compat, -Wshadow-ivar, -Wsized-deallocation, -Wsuggest-override, -Wuse-without-only. Change -Wnormalized=... operands to match 5.1. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbool-compare, -Wchkp, -Wdesignated-init, -Wdiscarded-array-qualifiers, -Wdiscarded-qualifiers, -Wformat-signedness, -Wincompatible-pointer-types, -Wint-conversion, -Wlogical-not-parentheses, -Wmemset-transposed-args, -Wodr, -Wshift-count-negative, -Wshift-count-overflow, -Wsizeof-array-argument, -Wsuggest-final-methods, -Wsuggest-final-types, -Wswitch-bool. Remove -Warray-bounds, and add -Warray-bounds=2 as a special case. --- ChangeLog | 20 +++++++++++++++++++- build-aux/gcc-warning.spec | 12 +++++++++++- m4/manywarnings.m4 | 23 ++++++++++++++++++++--- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 979e3e7aac..3a067a4307 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2015-04-24 Paul Eggert + + manywarnings: add GCC 5.1 warnings + * build-aux/gcc-warning.spec: Add -Wabi=, -Warray-bounds, + -Warray-bounds=, -Wc++14-compat, -Wc90-c99-compat, + -Wc99-c11-compat, -Wshadow-ivar, -Wsized-deallocation, + -Wsuggest-override, -Wuse-without-only. Change + -Wnormalized=... operands to match 5.1. + * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbool-compare, + -Wchkp, -Wdesignated-init, -Wdiscarded-array-qualifiers, + -Wdiscarded-qualifiers, -Wformat-signedness, + -Wincompatible-pointer-types, -Wint-conversion, + -Wlogical-not-parentheses, -Wmemset-transposed-args, -Wodr, + -Wshift-count-negative, -Wshift-count-overflow, + -Wsizeof-array-argument, -Wsuggest-final-methods, + -Wsuggest-final-types, -Wswitch-bool. Remove -Warray-bounds, + and add -Warray-bounds=2 as a special case. + 2015-04-21 Simon Josefsson doc: update FDL template to match FDL examples. @@ -1662,7 +1680,7 @@ o Test only that noncanonical values do not cause crashes, not that 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 + only for older GCC versions that need them. Handle -Wnormalized=nfc specially, so that the 'comm' command used for maintenance doesn't get confused. diff --git a/build-aux/gcc-warning.spec b/build-aux/gcc-warning.spec index 1c250dcb46..4a8c8f5ff0 100644 --- a/build-aux/gcc-warning.spec +++ b/build-aux/gcc-warning.spec @@ -2,16 +2,22 @@ --all-warnings alias for -Wall --extra-warnings alias for -Wextra -Wabi-tag c++ +-Wabi= c++ -Waggregate-return obsolescent -Waliasing fortran -Walign-commons fortran -Wampersand fortran +-Warray-bounds covered by -Warray-bounds= +-Warray-bounds= handled specially by gl_MANYWARN_ALL_GCC -Warray-temporaries fortran -Wassign-intercept objc/objc++ -Wc++-compat FIXME maybe? borderline. some will want this -Wc++0x-compat c++ -Wc++11-compat c++ +-Wc++14-compat c++ -Wc-binding-type fortran +-Wc90-c99-compat c compatibility +-Wc99-c11-compat c compatibility -Wcast-qual FIXME maybe? too much noise; encourages bad changes -Wcharacter-truncation fortran -Wcompare-reals fortran @@ -43,7 +49,7 @@ -Wnoexcept c++ -Wnon-template-friend c++ -Wnon-virtual-dtor c++ --Wnormalized= FIXME: choose something sane? +-Wnormalized= handled specially by gl_MANYWARN_ALL_GCC -Wold-style-cast c++ and objc++ -Woverloaded-virtual c++ -Wpadded FIXME maybe? warns about "stabil" member in /usr/include/bits/timex.h @@ -57,14 +63,17 @@ -Wredundant-decls FIXME maybe? many _gl_cxxalias_dummy FPs -Wreorder c++ and objc++ -Wselector objc and objc++ +-Wshadow-ivar objc -Wsign-compare FIXME maybe? borderline. some will want this -Wsign-conversion FIXME maybe? borderline. some will want this -Wsign-promo c++ and objc++ +-Wsized-deallocation c++ and objc++ -Wstack-usage= FIXME: choose something sane? -Wstrict-aliasing= FIXME: choose something sane? -Wstrict-null-sentinel c++ and objc++ -Wstrict-overflow= FIXME: choose something sane? -Wstrict-selector-match objc and objc++ +-Wsuggest-override c++ and objc++ -Wsurprising fortran -Wswitch-enum FIXME maybe? borderline. some will want this -Wsynth deprecated @@ -77,6 +86,7 @@ -Wunderflow fortran -Wunsuffixed-float-constants triggers warning in gnulib's timespec.h -Wunused-dummy-argument fortran +-Wuse-without-only fortran -Wuseless-cast c++ and objc++ -Wvirtual-move-assign c++ -Wzero-as-null-pointer-constant c++ and objc++ diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 44da98e38d..b4e38d9446 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -108,12 +108,13 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Waddress \ -Waggressive-loop-optimizations \ -Wall \ - -Warray-bounds \ -Wattributes \ -Wbad-function-cast \ + -Wbool-compare \ -Wbuiltin-macro-redefined \ -Wcast-align \ -Wchar-subscripts \ + -Wchkp \ -Wclobbered \ -Wcomment \ -Wcomments \ @@ -122,7 +123,10 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wdate-time \ -Wdeprecated \ -Wdeprecated-declarations \ + -Wdesignated-init \ -Wdisabled-optimization \ + -Wdiscarded-array-qualifiers \ + -Wdiscarded-qualifiers \ -Wdiv-by-zero \ -Wdouble-promotion \ -Wempty-body \ @@ -133,6 +137,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wformat-extra-args \ -Wformat-nonliteral \ -Wformat-security \ + -Wformat-signedness \ -Wformat-y2k \ -Wformat-zero-length \ -Wfree-nonheap-object \ @@ -140,15 +145,19 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wimplicit \ -Wimplicit-function-declaration \ -Wimplicit-int \ + -Wincompatible-pointer-types \ -Winit-self \ -Winline \ + -Wint-conversion \ -Wint-to-pointer-cast \ -Winvalid-memory-model \ -Winvalid-pch \ -Wjump-misses-init \ + -Wlogical-not-parentheses \ -Wlogical-op \ -Wmain \ -Wmaybe-uninitialized \ + -Wmemset-transposed-args \ -Wmissing-braces \ -Wmissing-declarations \ -Wmissing-field-initializers \ @@ -159,6 +168,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wnarrowing \ -Wnested-externs \ -Wnonnull \ + -Wodr \ -Wold-style-declaration \ -Wold-style-definition \ -Wopenmp-simd \ @@ -176,6 +186,9 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wreturn-type \ -Wsequence-point \ -Wshadow \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wsizeof-array-argument \ -Wsizeof-pointer-memaccess \ -Wstack-protector \ -Wstrict-aliasing \ @@ -185,7 +198,10 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], -Wsuggest-attribute=format \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ + -Wsuggest-final-methods \ + -Wsuggest-final-types \ -Wswitch \ + -Wswitch-bool \ -Wswitch-default \ -Wsync-nand \ -Wsystem-headers \ @@ -217,8 +233,9 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], 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. + # gcc --help=warnings outputs an unusual form for these options; list + # them here so that the above 'comm' command doesn't report a false match. + gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" # These are needed for older GCC versions. -- 2.39.5