aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJonathan Schoeller <jonathan.schoeller@rea-group.com>2020-06-02 06:24:10 +1000
committerJonathan Schoeller <jonathan.schoeller@rea-group.com>2020-06-02 06:24:10 +1000
commiteea81146571480b2acd12c8cd7f36b04d056c47f (patch)
tree6e61974d5c61fa99937c10853cd5fa256f6ae9b8 /configure.ac
parentd15db4b1fc988736b08c092d000ca1d1ff686975 (diff)
downloadbitcoin-eea81146571480b2acd12c8cd7f36b04d056c47f.tar.xz
build: Enable unreachable-code-loop-increment
Enable unreachable-code-loop-increment and treat as error. refs: #19015
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 34b8354cda..6955353693 100644
--- a/configure.ac
+++ b/configure.ac
@@ -391,6 +391,7 @@ if test "x$enable_werror" = "xyes"; then
dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010
AX_CHECK_COMPILE_FLAG([-Werror=suggest-override],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=suggest-override"],,[[$CXXFLAG_WERROR]],
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
+ AX_CHECK_COMPILE_FLAG([-Werror=unreachable-code-loop-increment],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
fi
if test "x$CXXFLAGS_overridden" = "xno"; then
@@ -410,6 +411,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsign-compare"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wsuggest-override],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"],,[[$CXXFLAG_WERROR]],
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
+ AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
dnl unknown options if any other warning is produced. Test the -Wfoo case, and