From 06eaf20571b43ded44bc1f47a479a361b0872901 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 30 May 2018 21:21:59 +0100 Subject: [PATCH] Problem: autoconf checks tautological compiler flag only for C++ Solution: check for C as well and set the flags separately --- configure.ac | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index aec54004..ef58b700 100644 --- a/configure.ac +++ b/configure.ac @@ -813,8 +813,14 @@ AM_CONDITIONAL([WITH_CLANG_FORMAT], [$WITH_CLANG_FORMAT]) AM_CONDITIONAL(ENABLE_STATIC, test "x$enable_static" = "xyes") # clang 6 has a warning that does not make sense on multi-platform code +AC_LANG_PUSH([C]) AX_CHECK_COMPILE_FLAG([-Wno-tautological-constant-compare], - [CFLAGS+=" -Wno-tautological-constant-compare" CXXFLAGS+=" -Wno-tautological-constant-compare"], + [CFLAGS+=" -Wno-tautological-constant-compare"], + [], + [-Werror]) +AC_LANG_POP([C]) +AX_CHECK_COMPILE_FLAG([-Wno-tautological-constant-compare], + [CXXFLAGS+=" -Wno-tautological-constant-compare"], [], [-Werror])