Add small tweaks to the code to fix compilation when ISC assertions are disabled

While implementing the new unit testing framework cmocka, it was found that the
BIND 9 code doesn't compile when assertions are disabled or replaced with any
function (such as mock_assert() from cmocka unit testing framework) that's not
directly recognized as assertion by the compiler.

This made the compiler to complain about blocks of code that was recognized as
unreachable before, but now it isn't.

The changes in this commit include:

* assigns default values to couple of local variables,
* moves some return statements around INSIST assertions,
* adds __builtin_unreachable(); annotations after some INSIST assertions,
* fixes one broken assertion (= instead of ==)
This commit is contained in:
Ondřej Surý
2018-06-04 13:41:09 +02:00
parent 8e292b3262
commit fbd2e47f51
16 changed files with 81 additions and 19 deletions

View File

@@ -60,6 +60,9 @@
/* Define to 1 if the compiler supports __builtin_expect. */
#undef HAVE_BUILTIN_EXPECT
/* define if the compiler supports __builtin_unreachable(). */
#undef HAVE_BUILTIN_UNREACHABLE
/* Define to 1 if you have the `catgets' function. */
#undef HAVE_CATGETS