aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2020-05-05 14:47:59 +0200
committerVasil Dimov <vd@FreeBSD.org>2020-05-05 14:47:59 +0200
commita30b0a24e97eae7f6d1428c5bf339a579872f28e (patch)
treefb9cb4d2b6acabfbce26f68a1353b7e4529b681b /configure.ac
parentec79b5f86b22ad8f77c736f9bb76c2e4d7faeaa4 (diff)
downloadbitcoin-a30b0a24e97eae7f6d1428c5bf339a579872f28e.tar.xz
build: enable -Werror=gnu
Stop the build if a warning is emitted due to `-Wgnu` and `--enable-werror` has been used. As usual - this would help notice such a warning that is about to be introduced in new code. This is a followup to https://github.com/bitcoin/bitcoin/pull/18088 build: ensure we aren't using GNU extensions
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac1
1 files changed, 1 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6046b05611..369611e3b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -338,6 +338,7 @@ if test "x$enable_werror" = "xyes"; then
if test "x$CXXFLAG_WERROR" = "x"; then
AC_MSG_ERROR("enable-werror set but -Werror is not usable")
fi
+ AX_CHECK_COMPILE_FLAG([-Werror=gnu],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=gnu"],,[[$CXXFLAG_WERROR]])
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]])