From 3831e2e9f355c557b0c0ed9712548b62feaf694f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 1 Jul 2020 17:00:51 -0700 Subject: manywarnings: improve port to GCC 10.1 * build-aux/gcc-warning.spec: Also list warnings that are default or are enabled by already-given flags. This lets us speed up checking for attributes, and makes the generated compilation commands shorter. Add -Wanalyzer-too-complex (too much noise). * m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT) (gl_MANYWARN_ALL_GCC): Use gl_AS_VAR_APPEND to append to shell variables that may have long values. (gl_MANYWARN_ALL_GCC): Omit flags that are default or are consequences of other flags, to speed up checking and shorten commands. --- build-aux/gcc-warning.spec | 144 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 138 insertions(+), 6 deletions(-) (limited to 'build-aux/gcc-warning.spec') diff --git a/build-aux/gcc-warning.spec b/build-aux/gcc-warning.spec index 89a0bc7346..6c0602be41 100644 --- a/build-aux/gcc-warning.spec +++ b/build-aux/gcc-warning.spec @@ -1,24 +1,51 @@ # options to filter out, and why --all-warnings alias for -Wall --extra-warnings alias for -Wextra +-W alias for -Wextra -Wabi this is now a no-op -Wabi-tag c++ -Wabi= c++ +-Wabsolute-value enabled by -Wextra +-Waddress enabled by -Wall +-Waddress-of-packed-member default -Waggregate-return obsolescent +-Waggressive-loop-optimizations default -Waliasing fortran -Walign-commons fortran -Waligned-new=[none|global|all] c++ --Walloc-size-larger-than= handled specially by gl_MANYWARN_ALL_GCC +-Walloc-size-larger-than= defaults to PTRDIFF_MAX -Walloc-zero Gnulib fixes this problem -Walloca we like alloca in small doses -Walloca-larger-than= FIXME: choose something sane? -Wampersand fortran +-Wanalyzer-double-fclose enabled by -fanalyzer +-Wanalyzer-double-free enabled by -fanalyzer +-Wanalyzer-exposure-through-output-file enabled by -fanalyzer +-Wanalyzer-file-leak enabled by -fanalyzer +-Wanalyzer-free-of-non-heap enabled by -fanalyzer +-Wanalyzer-malloc-leak enabled by -fanalyzer +-Wanalyzer-null-argument enabled by -fanalyzer +-Wanalyzer-null-dereference enabled by -fanalyzer +-Wanalyzer-possible-null-argument enabled by -fanalyzer +-Wanalyzer-possible-null-dereference enabled by -fanalyzer +-Wanalyzer-stale-setjmp-buffer implied by -fanalyzer +-Wanalyzer-tainted-array-index FIXME maybe? too much noise +-Wanalyzer-too-complex enabled by -fanalyzer +-Wanalyzer-unsafe-call-within-signal-handler enabled by -fanalyzer +-Wanalyzer-use-after-free enabled by -fanalyzer +-Wanalyzer-use-of-pointer-in-stale-stack-frame enabled by -fanalyzer -Warray-bounds covered by -Warray-bounds= -Warray-bounds=<0,2> handled specially by gl_MANYWARN_ALL_GCC -Warray-temporaries fortran -Wassign-intercept objc/objc++ -Wattribute-alias covered by -Wattribute-alias=2 -Wattribute-alias=<0,2> handled specially by gl_MANYWARN_ALL_GCC +-Wattribute-warning default +-Wattributes default +-Wbool-compare enabled by -Wall +-Wbool-operation enabled by -Wall +-Wbuiltin-declaration-mismatch default +-Wbuiltin-macro-redefined default -Wc++-compat only useful for code meant to be compiled by a C++ compiler -Wc++0x-compat c++ -Wc++11-compat c++ @@ -31,63 +58,120 @@ -Wc11-c2x-compat c compatibility -Wc90-c99-compat c compatibility -Wc99-c11-compat c compatibility +-Wcannot-profile default +-Wcast-align enabled by -Wcast-align=strict +-Wcast-function-type enabled by -Wextra -Wcast-qual FIXME maybe? too much noise; encourages bad changes -Wcast-result D -Wcatch-value c++ -Wcatch-value=<0,3> c++ +-Wchar-subscripts enabled by -Wall -Wcharacter-truncation fortran -Wchkp deprecated -Wclass-conversion c++ and objc++ -Wclass-memaccess c++ +-Wclobbered enabled by -Wextra -Wcomma-subscript c++ and objc++ +-Wcomment enabled by -Wall +-Wcomments alias for -Wcomment -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++ +-Wcoverage-mismatch default +-Wcpp default -Wctor-dtor-privacy c++ +-Wdangling-else enabled by -Wparentheses -Wdeclaration-after-statement FIXME: do not want. others may -Wdelete-incomplete c++ and objc++ -Wdelete-non-virtual-dtor c++ +-Wdeprecated default -Wdeprecated-copy c++ and objc++ -Wdeprecated-copy-dtor c++ and objc++ +-Wdeprecated-declarations default +-Wdesignated-init default +-Wdiscarded-array-qualifiers default +-Wdiscarded-qualifiers default -Wdo-subscript fortran +-Wdiv-by-zero default +-Wduplicate-decl-specifier enabled by -Wall -Weffc++ c++ +-Wempty-body enabled by -Wextra +-Wenum-compare enabled by -Wall +-Wenum-conversion enabled by -Wextra +-Wendif-labels default -Werror-implicit-function-declaration deprecated +-Wexpansion-to-defined enabled by -Wextra -Wextra-semi c++ -Wfloat-conversion FIXME maybe? borderline. some will want this -Wfloat-equal FIXME maybe? borderline. some will want this -Wformat covered by -Wformat=2 +-Wformat-contains-nul default +-Wformat-diag enabled by -Wformat=2 +-Wformat-extra-args enabled by -Wformat=2 +-Wformat-nonliteral enabled by -Wformat=2 -Wformat-overflow<0,2> gcc --help=warnings artifact -Wformat-overflow=<0,2> handled specially by gl_MANYWARN_ALL_GCC +-Wformat-security enabled by -Wformat=2 -Wformat-truncation covered by -Wformat-truncation=2 -Wformat-truncation=<0,2> handled specially by gl_MANYWARN_ALL_GCC +-Wformat-y2k enabled by -Wformat=2 +-Wformat-zero-length enabled by -Wformat=2 -Wformat=<0,2> gcc --help=warnings artifact +-Wframe-address enabled by -Wall -Wframe-larger-than= FIXME: choose something sane? +-Wfree-nonheap-object default -Wfunction-elimination fortran +-Whsa default +-Wif-not-aligned default +-Wignored-attributes default +-Wignored-qualifiers enabled by -Wextra +-Wimplicit enabled by -Wall -Wimplicit-fallthrough covered by -Wimplicit-fallthrough=2 -Wimplicit-fallthrough=<0,5> handled specially by gl_MANYWARN_ALL_GCC +-Wimplicit-function-declaration enabled by -Wimplicit +-Wimplicit-int enabled by -Wimplicit -Wimplicit-interface fortran -Wimplicit-procedure fortran -Winaccessible-base c++ and objc++ +-Wincompatible-pointer-types default -Winherited-variadic-ctor c++ -Winit-list-lifetime c++ and objc++ +-Wint-conversion default +-Wint-in-bool-context enabled by -Wall +-Wint-to-pointer-cast default -Winteger-division fortran -Wintrinsic-shadow fortran -Wintrinsics-std fortran +-Winvalid-memory-model default -Winvalid-offsetof c++ and objc++ -Wjump-misses-init only useful for code meant to be compiled by a C++ compiler -Wlarger-than- gcc --help=warnings artifact -Wlarger-than= FIXME: choose something sane? -Wline-truncation fortran -Wliteral-suffix c++ and objc++ +-Wlogical-not-parentheses enabled by -Wall -Wlong-long obsolescent -Wlto-type-mismatch c++ and objc++ +-Wmain enabled by -Wall +-Wmaybe-uninitialized enabled by -Wall or -Wextra +-Wmemset-elt-size enabled by -Wall +-Wmemset-transposed-args enabled by -Wall +-Wmisleading-indentation enabled by -Wall -Wmismatched-tags c++ and objc++ +-Wmissing-attributes enabled by -Wall +-Wmissing-braces enabled by -Wall +-Wmissing-field-initializers enabled by -Wextra -Wmissing-format-attribute obsolescent -Wmissing-noreturn obsolescent +-Wmissing-parameter-type enabled by -Wextra +-Wmissing-profile default +-Wmultichar default -Wmultiple-inheritance c++ and objc++ +-Wmultistatement-macros enabled by -Wall -Wnamespaces c++ +-Wnarrowing enabled by -Wall -Wno-alloc-size-larger-than see -Walloc-size-larger-than -Wno-alloca-larger-than see -Walloca-larger-than -Wno-frame-larger-than see -Wframe-larger-than @@ -98,21 +182,35 @@ -Wnoexcept-type c++ -Wnon-template-friend c++ -Wnon-virtual-dtor c++ --Wnormalized covered by -Wnormalized= --Wnormalized=[none|id|nfc|nfkc] handled specially by gl_MANYWARN_ALL_GCC +-Wnonnull enabled by -Wall or -Wformat +-Wnonnull-compare enabled by -Wall +-Wnormalized default +-Wnormalized=[none|id|nfc|nfkc] defaults to nfc +-Wodr default -Wold-style-cast c++ and objc++ +-Wold-style-declaration enabled by -Wextra +-Woverflow default -Woverloaded-virtual c++ +-Woverride-init enabled by -Wextra -Woverride-init-side-effects c++ and objc++ -Woverwrite-recursive fortran +-Wpacked-bitfield-compat default +-Wpacked-not-aligned enabled by -Wall -Wpadded FIXME maybe? warns about "stabil" member in /usr/include/bits/timex.h +-Wparentheses enabled by -Wall -Wpedantic FIXME: too strict? -Wpessimizing-move c++ and objc++ -Wplacement-new c++ -Wplacement-new=<0,2> c++ -Wpmf-conversions c++ and objc++ +-Wpointer-compare default +-Wpointer-sign enabled by -Wall +-Wpointer-to-int-cast default +-Wpragmas default -Wprio-ctor-dtor c++ -Wproperty-assign-default objc++ -Wprotocol objc++ +-Wpsabi default -Wreal-q-constant fortran -Wrealloc-lhs fortran -Wrealloc-lhs-all fortran @@ -121,53 +219,87 @@ -Wredundant-tags c++ and objc++ -Wregister c++ and objc++ -Wreorder c++ and objc++ +-Wrestrict enabled by -Wall +-Wreturn-local-addr default +-Wreturn-type enabled by -Wall +-Wscalar-storage-order default -Wselector objc and objc++ +-Wsequence-point enabled by -Wall -Wshadow-compatible-local covered by -Wshadow -Wshadow-ivar objc -Wshadow-local covered by -Wshadow -Wshadow=compatible-local covered by -Wshadow -Wshadow=global covered by -Wshadow -Wshadow=local covered by -Wshadow +-Wshift-count-negative default +-Wshift-count-overflow default +-Wshift-negative-value enabled by -Wextra -Wshift-overflow covered by -Wshift-overflow=2 -Wshift-overflow=<0,2> gcc --help=warnings artifact -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++ +-Wsizeof-array-argument default +-Wsizeof-pointer-div enabled by -Wall +-Wsizeof-pointer-memaccess enabled by -Wall -Wstack-usage= FIXME: choose something sane? +-Wstrict-aliasing enabled by -Wall -Wstrict-aliasing=<0,3> FIXME: choose something sane? -Wstrict-null-sentinel c++ and objc++ -Wstrict-overflow=<0,5> FIXME: choose something sane? -Wstrict-selector-match objc and objc++ --Wstringop-overflow covered by -Wstringop-overflow= --Wstringop-overflow=<0,4> handled specially by gl_MANYWARN_ALL_GCC +-Wstring-compare enabled by -Wextra +-Wstringop-overflow covered by -Wstringop-overflow=2 +-Wstringop-overflow=<0,4> defaults to 2 +-Wstringop-truncation default -Wsubobject-linkage c++ and objc++ -Wsuggest-override c++ and objc++ -Wsurprising fortran +-Wswitch enabled by -Wall +-Wswitch-bool default -Wswitch-default https://lists.gnu.org/r/bug-gnulib/2018-05/msg00179.html -Wswitch-enum FIXME maybe? borderline. some will want this +-Wswitch-outside-range default +-Wswitch-unreachable default -Wsynth deprecated -Wtabs fortran -Wtarget-lifetime fortran +-Wtautological-compare enabled by -Wall -Wtemplates c++ and objc++ -Wterminate c++ and objc++ -Wtraditional obsolescent -Wtraditional-conversion obsolescent +-Wtrigraphs enabled by -Wall +-Wtype-limits enabled by -Wextra -Wundeclared-selector objc and objc++ -Wundef FIXME maybe? too many false positives -Wundefined-do-loop fortran -Wunderflow fortran -Wunreachable-code obsolescent no-op -Wunsuffixed-float-constants triggers warning in gnulib's timespec.h --Wunused-const-variable covered by -Wunusec-const-variable=2 +-Wunused enabled by -Wall +-Wunused-but-set-parameter enabled by -Wunused +-Wunused-but-set-variable enabled by -Wunused +-Wunused-const-variable covered by -Wunused-const-variable=2 -Wunused-const-variable=<0,2> gcc --help=warnings artifact -Wunused-dummy-argument fortran +-Wunused-function enabled by -Wunused +-Wunused-label enabled by -Wunused +-Wunused-local-typedefs enabled by -Wunused +-Wunused-parameter enabled by -Wunused +-Wunused-result enabled by -Wunused +-Wunused-value enabled by -Wunused +-Wunused-variable enabled by -Wunused -Wuse-without-only fortran -Wuseless-cast c++ and objc++ +-Wvarargs default -Wvirtual-inheritance c++ -Wvirtual-move-assign c++ -Wvla-larger-than= handled specially by gl_MANYWARN_ALL_GCC -Wvolatile c++ and objc++ +-Wvolatile-register-var enabled by -Wall -Wzero-as-null-pointer-constant c++ and objc++ +-Wzero-length-bounds enabled by -Wall -Wzerotrip fortran -frequire-return-statement go -- cgit v1.2.1