Skip to content

Commit a845f1c

Browse files
committed
Merge bitcoin#23269: build: remove redundant warning flags
aa69fd6 build: Drop -Wno-unused-local-typedef (Hennadii Stepanov) 672e8c5 build: remove -Wunused-variable (fanquake) 5239af0 build: remove -Wswitch (fanquake) 0375906 build: use loop-analysis over range-loop-analysis (fanquake) 12712fa build: remove -Wsign-compare (fanquake) Pull request description: This remove the addition of flags that are already part of other options, such as `-Wall` or `-Wextra`; see each commit message for details. All of the flags being removed here already exist as part of `-Wall` as of GCC 8, or, for Clang, all exist in `-Wmost` (included in `-Wall)`, or as part of `-Wextra` as of Clang 7. Both of which are our minimum required compilers. Also cherry-picks one change from bitcoin#21458. To give an example of how GCCs `-Wall` has changed over the last few releases: ### 11.x to trunk (12.x) Added: ```bash -Wzero-length-bounds -Wmismatched-dealloc -Wmismatched-new-delete (only for C/C++) ``` ### 10.x to 11.x Added: ```bash -Warray-parameter=2 (C and Objective-C only) -Wrange-loop-construct (only for C++) -Wsizeof-array-div -Wvla-parameter (C and Objective-C only) ``` Removed: ```bash -Wenum-conversion in C/ObjC; ``` ### 9.x to 10.x Added: ```bash -Wenum-conversion in C/ObjC; -Wformat-overflow -Wformat-truncation -Wzero-length-bounds ``` ### 8.x to 9.x Added: ```bash -Wpessimizing-move ``` Removed: ```bash -Wstringop-truncation ``` ### 7.x to 8.x Added: ```bash -Wcatch-value (C++ and Objective-C++ only) -Wmissing-attributes -Wmultistatement-macros -Wrestrict -Wsizeof-pointer-div -Wstringop-truncation ``` [Clang Warning Options](https://clang.llvm.org/docs/DiagnosticsReference.html) [GCC Warning Options](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html) ACKs for top commit: meshcollider: utACK aa69fd6 Tree-SHA512: 34dde6bd773c864202c151eaa35f902d03fb531c27fe5e1ef659225da03acade2efe5df56df3efb4df5bbded3d395348ce03c25b837fce83be53af3352f0f2bc
2 parents 5a044da + aa69fd6 commit a845f1c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

configure.ac

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,12 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
425425
AX_CHECK_COMPILE_FLAG([-Wformat -Wformat-security],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat -Wformat-security"],,[[$CXXFLAG_WERROR]])
426426
AX_CHECK_COMPILE_FLAG([-Wvla],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]])
427427
AX_CHECK_COMPILE_FLAG([-Wshadow-field],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow-field"],,[[$CXXFLAG_WERROR]])
428-
AX_CHECK_COMPILE_FLAG([-Wswitch],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wswitch"],,[[$CXXFLAG_WERROR]])
429428
AX_CHECK_COMPILE_FLAG([-Wthread-safety],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety"],,[[$CXXFLAG_WERROR]])
430-
AX_CHECK_COMPILE_FLAG([-Wrange-loop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wrange-loop-analysis"],,[[$CXXFLAG_WERROR]])
429+
AX_CHECK_COMPILE_FLAG([-Wloop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wloop-analysis"],,[[$CXXFLAG_WERROR]])
431430
AX_CHECK_COMPILE_FLAG([-Wredundant-decls],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"],,[[$CXXFLAG_WERROR]])
432-
AX_CHECK_COMPILE_FLAG([-Wunused-variable],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-variable"],,[[$CXXFLAG_WERROR]])
433431
AX_CHECK_COMPILE_FLAG([-Wunused-member-function],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-member-function"],,[[$CXXFLAG_WERROR]])
434432
AX_CHECK_COMPILE_FLAG([-Wdate-time],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"],,[[$CXXFLAG_WERROR]])
435433
AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"],,[[$CXXFLAG_WERROR]])
436-
AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsign-compare"],,[[$CXXFLAG_WERROR]])
437434
AX_CHECK_COMPILE_FLAG([-Wduplicated-branches],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-branches"],,[[$CXXFLAG_WERROR]])
438435
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"],,[[$CXXFLAG_WERROR]])
439436
AX_CHECK_COMPILE_FLAG([-Wlogical-op],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"],,[[$CXXFLAG_WERROR]])
@@ -454,7 +451,6 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
454451
dnl set the -Wno-foo case if it works.
455452
AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"],,[[$CXXFLAG_WERROR]])
456453
AX_CHECK_COMPILE_FLAG([-Wself-assign],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
457-
AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
458454
if test x$suppress_external_warnings != xyes ; then
459455
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"],,[[$CXXFLAG_WERROR]])
460456
fi

0 commit comments

Comments
 (0)