aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-07-29 08:21:27 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-07-29 08:21:30 -0400
commit502ec022729085da7569bc9760d6d0d1ffbcf224 (patch)
treeeb46ec2ddab4b727b9e479b4e05e7005abd36109
parent5c2885f9b2e3340ef0558c9924e5386716a8d3b9 (diff)
parentfabfcb5d8ec35442f81c6e6fd33abff52bbe0fde (diff)
downloadbitcoin-502ec022729085da7569bc9760d6d0d1ffbcf224.tar.xz
Merge #16424: build: Treat -Wswitch as error when --enable-werror
fabfcb5d8ec35442f81c6e6fd33abff52bbe0fde build: Treat -Wswitch as error when --enable-werror (MarcoFalke) Pull request description: By default we set `-Wall`, which enabled `-Wswitch`, so this already prints warnings. However, it can be additionally be turned into an error when `--enable-werror` to be extra safe. ACKs for top commit: practicalswift: utACK fabfcb5d8ec35442f81c6e6fd33abff52bbe0fde Empact: ACK https://github.com/bitcoin/bitcoin/pull/16424/commits/fabfcb5d8ec35442f81c6e6fd33abff52bbe0fde Tree-SHA512: f6bd6dba93a4f3740811eb338b6db93b4f72d237afe848aefd212abecaf4f430c5a417ccb2f9fec0bdbc46001176f0cfa0bbf4d99a7fcf0e34dca4a9476e8456
-rw-r--r--configure.ac2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 08a850cfa2..220c82748e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -323,6 +323,7 @@ if test "x$enable_werror" = "xyes"; then
AC_MSG_ERROR("enable-werror set but -Werror is not usable")
fi
AX_CHECK_COMPILE_FLAG([-Werror=vla],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=vla"],,[[$CXXFLAG_WERROR]])
+ AX_CHECK_COMPILE_FLAG([-Werror=switch],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=switch"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Werror=thread-safety-analysis],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=thread-safety-analysis"],,[[$CXXFLAG_WERROR]])
fi
@@ -331,6 +332,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wextra],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wformat],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wvla],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]])
+ AX_CHECK_COMPILE_FLAG([-Wswitch],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wswitch"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wformat-security],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat-security"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wthread-safety-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety-analysis"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wrange-loop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wrange-loop-analysis"],,[[$CXXFLAG_WERROR]])