]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
When ISC assertions are disabled, still execute the condition to prevent unused varia...
authorOndřej Surý <ondrej@sury.org>
Sat, 13 Oct 2018 09:52:08 +0000 (11:52 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 8 Nov 2018 05:21:53 +0000 (12:21 +0700)
lib/isc/include/isc/assertions.h

index e5719d98d77e62d3f8f5099bceceea30d5eade95..62e883d17bc757b223a6bc4362ce3fd9781eca65 100644 (file)
@@ -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