gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 03/10: configure: added more workarounds for clang


From: gnunet
Subject: [libmicrohttpd] 03/10: configure: added more workarounds for clang
Date: Tue, 31 May 2022 19:38:12 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit b3b131c6b96fd9a83c7cc6dbc34f9f86774a0efb
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue May 31 19:02:07 2022 +0300

    configure: added more workarounds for clang
---
 configure.ac | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7cba50af..389d4861 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,21 @@ MHD_CHECK_ADD_CC_CFLAG([-fno-strict-aliasing], [CFLAGS_ac])
 
 AS_VAR_IF([enable_build_type],["neutral"],[],
   [ # Any non-neutral build types
+    AC_CACHE_CHECK([whether workarounds for clang or clang-based compiler are 
required],
+      [mhd_cv_cc_clang_based],
+      [
+        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#if ! defined(__clang__) && ! defined(__llvm__)
+#error Compiler is not clang-based
+choke me now
+#endif
+              ]]
+            )
+          ],
+          [mhd_cv_cc_clang_based="yes"],[mhd_cv_cc_clang_based="no"]
+        )
+      ]
+    )
     MHD_CHECK_ADD_CC_CFLAGS([-Wall -fdelete-null-pointer-checks 
-Wnull-dereference], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wdeclaration-after-statement -Wimplicit 
-Wnested-externs], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wredundant-decls -Wtrampolines 
-Wunsafe-loop-optimizations], [CFLAGS_ac])
@@ -160,25 +175,6 @@ AS_CASE([${enable_build_type}],[debug|debugger],
     CFLAGS="${user_CFLAGS}"
     AS_VAR_IF([enable_build_type],["debug"],
       [
-        AS_IF([test "x${enable_sanitizers}" != "xno"],
-          [
-            AC_CACHE_CHECK([whether workarounds for clang are required],
-              [mhd_cv_cc_clang_based],
-              [
-                AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#if ! defined(__clang__) && ! defined(__llvm__)
-#error Compiler is not clang-based
-choke me now
-#endif
-                      ]]
-                    )
-                  ],
-                  [mhd_cv_cc_clang_based="yes"],[mhd_cv_cc_clang_based="no"]
-                )
-              ]
-            )
-          ]
-        )
         # Clang has ASAN (pointer compare) broken when '-Og' optimisations are 
used
         AS_IF([test "x${enable_sanitizers}" != "xno" && test 
"x${mhd_cv_cc_clang_based}" = "xyes"],
           [MHD_CHECK_ADD_CC_CFLAG([-O0], [CFLAGS_ac])],
@@ -189,7 +185,13 @@ choke me now
     )
     MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-ggdb3], [-g3], [-ggdb], [-g])
     MHD_CHECK_ADD_CC_CFLAGS([-Wextra -Wdouble-promotion], [CFLAGS_ac])
-    MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-Wformat=2], [-Wformat])
+    MHD_FIND_ADD_CC_CFLAG_IFELSE(
+      [
+        # clang produce warning when string pointer is used as a formar for 
v*printf() function
+        
AS_VAR_IF([mhd_cv_cc_clang_based],["yes"],[MHD_CHECK_ADD_CC_CFLAG([-Wno-format-nonliteral],
 [CFLAGS_ac])])
+      ],[],
+      [CFLAGS_ac], [-Wformat=2], [-Wformat]
+    )
     MHD_CHECK_ADD_CC_CFLAGS([-Wformat-overflow -Wformat-truncation 
-Wformat-security -Wformat-signedness], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wmissing-include-dirs -Wshift-overflow=2 
-Wstringop-overflow=4 -Walloc-zero], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wduplicated-branches -Wduplicated-cond 
-Wfloat-equal -Wshadow -Wpointer-arith], [CFLAGS_ac])

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]