]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
m4: adding check for clang -Wstrict-bool availability
authorMarco Bettini <marco.bettini@open-xchange.com>
Mon, 2 May 2022 11:13:41 +0000 (11:13 +0000)
committermartti.rannanjarvi <martti.rannanjarvi@open-xchange.com>
Thu, 19 May 2022 06:25:58 +0000 (06:25 +0000)
configure.ac
m4/dovecot.m4

index 82f83915c7bb11ce8a5bae8fcce34e24b513de73..f082dcd43b19020635d7335e7ff9faf3caeefca7 100644 (file)
@@ -316,6 +316,7 @@ AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h \
   sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h crypt.h)
 
 CC_CLANG
+CC_STRICT_BOOL
 AC_LD_WHOLE_ARCHIVE
 DC_DOVECOT_HARDENING
 DC_DOVECOT_FUZZER
index 037d5e40e673b564c6f4c52d72bfd6d4cebea359..8092bf57c2b15ef184d1e27289c4c3306001f1ed 100644 (file)
@@ -421,6 +421,7 @@ AC_DEFUN([DC_DOVECOT],[
        ])
 
        CC_CLANG
+       CC_STRICT_BOOL
        DC_DOVECOT_CFLAGS
        DC_DOVECOT_HARDENING
 
@@ -566,6 +567,15 @@ AC_DEFUN([CC_CLANG],[
   AC_MSG_RESULT([$have_clang])
 ])
 
+AC_DEFUN([CC_STRICT_BOOL], [
+  AS_IF([test $have_clang = yes], [
+    AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+    gl_COMPILER_OPTION_IF([-Wstrict-bool], [
+      AC_DEFINE(HAVE_STRICT_BOOL,, [we have strict bool])
+    ])
+  ])
+])
+
 AC_DEFUN([DOVECOT_WANT_UBSAN], [
   AC_ARG_ENABLE(ubsan,
     AS_HELP_STRING([--enable-ubsan], [Enable undefined behaviour sanitizes (default=no)]),