From: Ondřej Surý Date: Sat, 13 Oct 2018 09:52:08 +0000 (+0200) Subject: When ISC assertions are disabled, still execute the condition to prevent unused varia... X-Git-Tag: v9.13.4~46^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a831e0f72df901ff046ab0e4b7c14debb5d0ddbc;p=thirdparty%2Fbind9.git When ISC assertions are disabled, still execute the condition to prevent unused variable warnings/errors from the compiler --- diff --git a/lib/isc/include/isc/assertions.h b/lib/isc/include/isc/assertions.h index e5719d98d77..62e883d17bc 100644 --- a/lib/isc/include/isc/assertions.h +++ b/lib/isc/include/isc/assertions.h @@ -80,7 +80,7 @@ isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_require, \ #cond), 0))) #else -#define ISC_REQUIRE(cond) ((void) 0) +#define ISC_REQUIRE(cond) ((void) ISC_LIKELY(cond)) #endif /* ISC_CHECK_REQUIRE */ #if ISC_CHECK_ENSURE != 0 @@ -90,7 +90,7 @@ isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_ensure, \ #cond), 0))) #else -#define ISC_ENSURE(cond) ((void) 0) +#define ISC_ENSURE(cond) ((void) ISC_LIKELY(cond)) #endif /* ISC_CHECK_ENSURE */ #if ISC_CHECK_INSIST != 0 @@ -100,7 +100,7 @@ isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_insist, \ #cond), 0))) #else -#define ISC_INSIST(cond) ((void) 0) +#define ISC_INSIST(cond) ((void) ISC_LIKELY(cond)) #endif /* ISC_CHECK_INSIST */ #if ISC_CHECK_INVARIANT != 0 @@ -110,7 +110,7 @@ isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_invariant, \ #cond), 0))) #else -#define ISC_INVARIANT(cond) ((void) 0) +#define ISC_INVARIANT(cond) ((void) ISC_LIKELY(cond)) #endif /* ISC_CHECK_INVARIANT */ ISC_LANG_ENDDECLS