From: Paul Eggert Date: Fri, 1 May 2026 16:02:37 +0000 (-0700) Subject: manywarnings: simplify C warning audits X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3210a5bedd76e4290772ae0597fda076fcc5263;p=thirdparty%2Fgnulib.git manywarnings: simplify C warning audits * build-aux/gcc-warning.spec: Omit many c++, objc, obcj++, fortran warnings as we no longer need to track them here. Mark a few of these warnings as now being defaults (for C too). * m4/manywarnings.m4: In comment that says how to audit this file, use ‘gcc --help=c,warnings’ and ‘gcc --help=common,warnings’ instead of ‘gcc --help=warnings’, as the latter outputs irrelevant warnings about c++, objc, obcj++, fortran. --- diff --git a/ChangeLog b/ChangeLog index a7fcf8b4a6..9dbc2f82e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2026-05-01 Paul Eggert + + manywarnings: simplify C warning audits + * build-aux/gcc-warning.spec: Omit many c++, objc, obcj++, + fortran warnings as we no longer need to track them here. + Mark a few of these warnings as now being defaults (for C too). + * m4/manywarnings.m4: In comment that says how to audit this file, + use ‘gcc --help=c,warnings’ and ‘gcc --help=common,warnings’ + instead of ‘gcc --help=warnings’, as the latter outputs irrelevant + warnings about c++, objc, obcj++, fortran. + 2026-05-01 Bruno Haible stdc_rotate_left tests, stdc_rotate_right tests: Fix gcc warning. diff --git a/build-aux/gcc-warning.spec b/build-aux/gcc-warning.spec index 8bac144d45..151beba027 100644 --- a/build-aux/gcc-warning.spec +++ b/build-aux/gcc-warning.spec @@ -4,22 +4,17 @@ -W alias for -Wextra -WNSObject-attribute objc and objc++ -Wabi this is now a no-op --Wabi-tag c++ and objc++ -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 enabled by -Wextra -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-allocation-size enabled by -fanalyzer -Wanalyzer-deref-before-check enabled by -fanalyzer -Wanalyzer-double-fclose enabled by -fanalyzer @@ -76,8 +71,6 @@ -Warray-compare enabled by -Wall -Warray-parameter enabled by -Wall -Warray-parameter=<0,2> enabled by -Wall --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 @@ -89,20 +82,6 @@ -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++ --Wc++11-extensions c++ --Wc++14-compat c++ --Wc++14-extensions c++ --Wc++17-compat c++ --Wc++17-extensions c++ --Wc++1z-compat c++ --Wc++20-compat c++ --Wc++20-extensions c++ --Wc++23-extensions c++ --Wc++26-extensions c++ --Wc++2a-compat c++ --Wc-binding-type fortran -Wc11-c23-compat c compatibility -Wc23-c2y-compat c compatibility -Wc90-c99-compat c compatibility @@ -112,71 +91,40 @@ -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 --Wcast-user-defined default --Wcatch-value c++ --Wcatch-value=<0,3> c++ --Wchanges-meaning 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-distinct-pointer-types default --Wcompare-reals fortran -Wcomplain-wrong-lang default --Wconditionally-supported c++ and objc++ -Wconversion FIXME maybe? too much noise; encourages bad changes --Wconversion-extra fortran --Wconversion-null c++ and objc++ -Wcoverage-invalid-line-number default if --coverage -Wcoverage-mismatch default -Wcoverage-too-many-conditions default -Wcoverage-too-many-paths default -Wcpp default --Wctad-maybe-unsupported c++ and objc++ --Wctor-dtor-privacy c++ and objc++ -Wdangling-else enabled by -Wparentheses -Wdangling-pointer enabled by -Wall -Wdangling-pointer=<0,2> enabled by -Wall --Wdangling-reference c++ and objc++ -Wdeclaration-after-statement needed only for pre-C99, so obsolete -Wdeclaration-missing-parameter-type default --Wdefaulted-function-deleted default, c++ and objc++ --Wdelete-incomplete c++ and objc++ --Wdelete-non-virtual-dtor c++ and objc++ -Wdeprecated default --Wdeprecated-copy c++ and objc++ --Wdeprecated-copy-dtor c++ and objc++ -Wdeprecated-declarations default --Wdeprecated-enum-enum-conversion c++ and objc++ --Wdeprecated-enum-float-conversion c++ and objc++ --Wdeprecated-literal-operator c++ and objc++ -Wdeprecated-non-prototype c compatibility --Wdeprecated-variadic-comma-omission c++ and objc+++ compatibility -Wdesignated-init default -Wdisabled-optimization warns about compiler not about program -Wdiscarded-array-qualifiers default -Wdiscarded-qualifiers default -Wdiv-by-zero default --Wdo-subscript fortran -Wduplicate-decl-specifier enabled by -Wall --Weffc++ c++ --Welaborated-enum-base default, c++11+ -Wempty-body enabled by -Wextra -Wendif-labels default -Wenum-compare enabled by -Wall -Wenum-conversion enabled by -Wextra -Wenum-int-mismatch enabled by -Wall -Werror-implicit-function-declaration deprecated --Wexceptions c++ and objc++ -Wexpansion-to-defined enabled by -Wextra --Wexternal-argument-mismatch fortran --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 @@ -196,8 +144,6 @@ -Wframe-larger-than= FIXME: choose something sane? -Wfree-labels c and objc compatibility -Wfree-nonheap-object default --Wfunction-elimination fortran --Wglobal-module default, c++ and objc++ -Whardened default -Wheader-guard enabled by -Wall -Whsa default @@ -209,34 +155,20 @@ -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 -Winfinite-recursion enabled by -Wall --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 --Winterference-size c++ --Wintrinsic-shadow fortran --Wintrinsics-std fortran --Winvalid-constexpr c++ --Winvalid-imported-macros c++ -Winvalid-memory-model default --Winvalid-offsetof c++ and objc++ -Winvalid-utf8 enabled by -finput-charset=UTF-8 -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? -Wleading-whitespace= specific to project coding style --Wline-truncation fortran --Wliteral-suffix c++ and objc++ -Wlogical-not-parentheses enabled by -Wall -Wlong-long obsolescent --Wlto-type-mismatch c++ and objc++ +-Wlto-type-mismatch default -Wmain enabled by -Wall -Wmaybe-musttail-local-addr enabled by -Wextra -Wmaybe-uninitialized enabled by -Wall or -Wextra @@ -244,9 +176,6 @@ -Wmemset-transposed-args enabled by -Wall -Wmisleading-indentation enabled by -Wall -Wmismatched-dealloc default --Wmismatched-new-delete default, c++ and objc++ --Wmismatched-special-enum d --Wmismatched-tags c++ and objc++ -Wmissing-attributes enabled by -Wall -Wmissing-braces enabled by -Wall -Wmissing-field-initializers enabled by -Wextra @@ -255,13 +184,9 @@ -Wmissing-parameter-name c and objc compatibility -Wmissing-parameter-type enabled by -Wextra -Wmissing-profile default --Wmissing-requires default, c++ --Wmissing-template-keyword default, c++ -Wmultichar default --Wmultiple-inheritance c++ and objc++ -Wmultistatement-macros enabled by -Wall -Wmusttail-local-addr default --Wnamespaces c++ -Wnarrowing enabled by -Wall -Wno-alloc-size-larger-than see -Walloc-size-larger-than -Wno-alloca-larger-than see -Walloca-larger-than @@ -269,64 +194,37 @@ -Wno-larger-than see -Wlarger-than -Wno-stack-usage see -Wstack-usage -Wno-vla-larger-than see -Wvla-larger-than --Wnoexcept c++ --Wnoexcept-type c++ --Wnon-template-friend c++ --Wnon-virtual-dtor c++ -Wnonnull enabled by -Wall or -Wformat -Wnonnull-compare enabled by -Wall -Wnormalized default -Wnormalized=[none|id|nfc|nfkc] defaults to nfc --Wnrvo c++ and objc++ --Wobjc-root-class objc and objc++ -Wodr default --Wold-style-cast c++ and objc++ -Wold-style-declaration enabled by -Wextra -Wopenacc-parallelism OpenACC -Wopenmp default -Woverflow default --Woverloaded-virtual c++ --Woverloaded-virtual=<0,2> c++ -Woverride-init enabled by -Wextra --Woverride-init-side-effects c++ and objc++ --Woverwrite-recursive fortran +-Woverride-init-side-effects default -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 -Wpragma-once-outside-header default -Wpragmas default --Wprio-ctor-dtor c++ --Wproperty-assign-default objc++ --Wprotocol objc++ +-Wprio-ctor-dtor default -Wpsabi default --Wrange-loop-construct c++ and objc++ --Wreal-q-constant fortran --Wrealloc-lhs fortran --Wrealloc-lhs-all fortran -Wredundant-decls FIXME maybe? many _gl_cxxalias_dummy FPs --Wredundant-move c++ and objc++ --Wredundant-tags c++ and objc++ --Wregister c++ and objc++ --Wreorder c++ and objc++ -Wrestrict enabled by -Wall -Wreturn-local-addr default -Wreturn-mismatch default -Wreturn-type enabled by -Wall -Wscalar-storage-order default --Wselector objc and objc++ --Wself-move c++ 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 @@ -338,8 +236,6 @@ -Wshift-overflow=<0,2> gcc --help=warnings artifact -Wsign-compare enabled by -Wextra -Wsign-conversion FIXME maybe? borderline. some will want this --Wsign-promo c++ and objc++ --Wsized-deallocation c++ and objc++ -Wsizeof-array-argument default -Wsizeof-array-div enabled by -Wall -Wsizeof-pointer-div enabled by -Wall @@ -347,36 +243,23 @@ -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++ -Wstring-compare enabled by -Wextra -Wstringop-overflow covered by -Wstringop-overflow=2 -Wstringop-overflow=<0,4> defaults to 2 -Wstringop-overread default -Wstringop-truncation default --Wsubobject-linkage c++ and objc++ -Wsuggest-attribute=returns_nonnull https://gcc.gnu.org/PR114833 -Wsuggest-final-methods c++ -Wsuggest-final-types c++ --Wsuggest-override c++ --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 -Wsystem-headers warns about system headers on macOS and #include_next in gnulib headers --Wtabs fortran --Wtarget-lifetime fortran -Wtautological-compare enabled by -Wall --Wtemplate-body default, c++ and objc++ --Wtemplate-id-cdtor default, c++ and objc++ --Wtemplate-names-tu-local enabled by -Wextra, c++ --Wtemplates c++ and objc++ --Wterminate c++ and objc++ -Wtraditional obsolescent -Wtraditional-conversion obsolescent -Wtrailing-whitespace specific to project coding style @@ -385,10 +268,7 @@ -Wtrivial-auto-var-init subsumed by -Wmaybe-uninitialized -Wtsan default -Wtype-limits enabled by -Wextra --Wundeclared-selector objc and objc++ -Wundef FIXME maybe? too many false positives --Wundefined-do-loop fortran --Wunderflow fortran -Wunicode default -Wunreachable-code obsolescent no-op -Wunsuffixed-float-constants triggers warning in gnulib's timespec.h @@ -398,28 +278,19 @@ -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 -Wextra -Wunused -Wunused-result enabled by -Wunused -Wunused-value enabled by -Wunused -Wunused-variable enabled by -Wunused -Wuse-after-free handled specially by gl_MANYWARN_ALL_GCC -Wuse-after-free=<0,3> handled specially by gl_MANYWARN_ALL_GCC --Wuse-without-only fortran -Wuseless-cast c++ and objc++ -Wvarargs default --Wvexing-parse c++ and objc++ --Wvirtual-inheritance c++ --Wvirtual-move-assign c++ -Wvla-larger-than= handled specially by gl_MANYWARN_ALL_GCC -Wvla-parameter enabled by -Wall --Wvolatile c++ and objc++ -Wvolatile-register-var enabled by -Wall -Wxor-used-as-pow default -Wzero-as-null-pointer-constant handled specially by gl_MANYWARN_ALL_GCC -Wzero-length-bounds enabled by -Wall --Wzerotrip fortran --frequire-return-statement go diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 85c5a08551..88e7ad6646 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,5 +1,5 @@ # manywarnings.m4 -# serial 33 +# serial 34 dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -97,7 +97,8 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], # export LC_ALL=C && comm -3 \ # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\).*/\1/p' manywarnings.m4; \ # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \ - # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) + # <((gcc --help=c,warnings && gcc --help=common,warnings) \ + # | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) $1= for gl_manywarn_item in -fanalyzer -fstrict-flex-arrays \