diff --git a/bin/tests/test_client.c b/bin/tests/test_client.c index 10517f24c7..edc6d66320 100644 --- a/bin/tests/test_client.c +++ b/bin/tests/test_client.c @@ -232,7 +232,7 @@ parse_options(int argc, char **argv) { break; default: - INSIST(0); + UNREACHABLE(); } } diff --git a/bin/tests/test_server.c b/bin/tests/test_server.c index 066dcf9e7f..2d80db4457 100644 --- a/bin/tests/test_server.c +++ b/bin/tests/test_server.c @@ -152,7 +152,7 @@ parse_options(int argc, char **argv) { break; default: - INSIST(0); + UNREACHABLE(); } } diff --git a/cocci/unreachable.spatch b/cocci/unreachable.spatch index 100f1a0abe..84c0c344bb 100644 --- a/cocci/unreachable.spatch +++ b/cocci/unreachable.spatch @@ -11,3 +11,9 @@ - INSIST(0); - ISC_UNREACHABLE(); + UNREACHABLE(); + +@@ +@@ + +- UNREACHABLE(); + UNREACHABLE(); diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index 4fa7501e32..aa611d7c73 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -2590,7 +2590,7 @@ dns_rpz_find_ip(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type, zbits &= have.nsipv4; break; default: - INSIST(0); + UNREACHABLE(); break; } } else if (netaddr->family == AF_INET6) { @@ -2616,7 +2616,7 @@ dns_rpz_find_ip(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type, zbits &= have.nsipv6; break; default: - INSIST(0); + UNREACHABLE(); break; } } else { diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 2bce1c7d7c..17d2004685 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -2273,7 +2273,7 @@ isc__nm_process_sock_buffer(isc_nmsocket_t *sock) { } break; default: - INSIST(0); + UNREACHABLE(); } } } @@ -2799,7 +2799,6 @@ isc__nmsocket_reset(isc_nmsocket_t *sock) { REQUIRE(sock->parent == NULL); break; default: - INSIST(0); UNREACHABLE(); break; } @@ -3493,7 +3492,6 @@ isc_nm_set_maxage(isc_nmhandle_t *handle, const uint32_t ttl) { case isc_nm_tlssocket: #endif /* HAVE_LIBNGHTTP2 */ default: - INSIST(0); UNREACHABLE(); break; } diff --git a/lib/isc/rwlock.c b/lib/isc/rwlock.c index c76ea74dda..2691a44de4 100644 --- a/lib/isc/rwlock.c +++ b/lib/isc/rwlock.c @@ -82,7 +82,7 @@ isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { } break; default: - INSIST(0); + UNREACHABLE(); } switch (ret) { diff --git a/lib/isc/timer.c b/lib/isc/timer.c index f833000601..5d54e3843a 100644 --- a/lib/isc/timer.c +++ b/lib/isc/timer.c @@ -117,7 +117,6 @@ schedule(isc_timer_t *timer, isc_time_t *now, bool signal_ok) { due = timer->idle; break; default: - INSIST(0); UNREACHABLE(); } @@ -425,7 +424,6 @@ dispatch(isc_timermgr_t *manager, isc_time_t *now) { need_schedule = false; break; default: - INSIST(0); UNREACHABLE(); } diff --git a/lib/ns/query.c b/lib/ns/query.c index cb1a579307..b9e76eb897 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -293,7 +293,7 @@ get_hooktab(query_ctx_t *qctx) { result = _res; \ goto cleanup; \ default: \ - INSIST(0); \ + UNREACHABLE(); \ } \ } \ } while (false)