]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix clang analyzer for optimize compile analysis.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Oct 2018 10:51:05 +0000 (10:51 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Oct 2018 10:51:05 +0000 (10:51 +0000)
git-svn-id: file:///svn/unbound/trunk@4922 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/log.h

index 94fa1670840cbc3b193934ac1627a3218cd438b4..94ea51d018b18d2ad7527c4369cc018127d4b915 100644 (file)
@@ -1,6 +1,7 @@
 2 October 2018: Wouter
        - updated contrib/fastrpz.patch to apply for this version
        - dnscrypt.c removed sizeof to get array bounds.
+       - Fix clang analyzer for optimize compile analysis.
 
 1 October 2018: Wouter
        - tag for release 1.8.1rc1.
index f73c0754d657f0661d0afc3922db9f82c01e3277..f171dabefcf26fd0a66decf810b356d14284cfa0 100644 (file)
@@ -201,8 +201,13 @@ void log_vmsg(int pri, const char* type, const char* format, va_list args);
        } while(0);
 #endif
 #else
+#ifdef __clang_analyzer__
+/* tell clang analyzer that the code path with !x is not there */
+#define log_assert(x) if(!(x)) fatal_exit("error")
+#else
 #  define log_assert(x) /*nothing*/
 #endif
+#endif
 
 #ifdef USE_WINSOCK
 /**