From: Wouter Wijngaards Date: Tue, 2 Oct 2018 10:51:05 +0000 (+0000) Subject: - Fix clang analyzer for optimize compile analysis. X-Git-Tag: release-1.8.2rc1~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c85ff492d0fcf58db663a30611569f029ce50dfc;p=thirdparty%2Funbound.git - Fix clang analyzer for optimize compile analysis. git-svn-id: file:///svn/unbound/trunk@4922 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 94fa16708..94ea51d01 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/util/log.h b/util/log.h index f73c0754d..f171dabef 100644 --- a/util/log.h +++ b/util/log.h @@ -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 /**