]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Simplify way we tag unreachable code with only ISC_UNREACHABLE()
authorOndřej Surý <ondrej@sury.org>
Mon, 11 Oct 2021 10:50:17 +0000 (12:50 +0200)
committerOndřej Surý <ondrej@isc.org>
Fri, 25 Mar 2022 08:33:51 +0000 (09:33 +0100)
Previously, the unreachable code paths would have to be tagged with:

    INSIST(0);
    ISC_UNREACHABLE();

There was also older parts of the code that used comment annotation:

    /* NOTREACHED */

Unify the handling of unreachable code paths to just use:

    UNREACHABLE();

The UNREACHABLE() macro now asserts when reached and also uses
__builtin_unreachable(); when such builtin is available in the compiler.

(cherry picked from commit 584f0d7a7e89f4681b78dee157f7a2807812023a)

88 files changed:
bin/check/named-checkconf.c
bin/check/named-checkzone.c
bin/confgen/ddns-confgen.c
bin/delv/delv.c
bin/dig/dig.c
bin/dig/dighost.c
bin/dnssec/dnssec-keyfromlabel.c
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssectool.c
bin/named/config.c
bin/named/logconf.c
bin/named/server.c
bin/named/zoneconf.c
bin/tests/system/rpz/dnsrps.c
bin/tests/wire_test.c
bin/tools/mdig.c
cocci/unreachable.spatch
contrib/dlz/modules/wildcard/dlz_wildcard_dynamic.c
doc/dev/style.md
lib/bind9/check.c
lib/dns/acl.c
lib/dns/client.c
lib/dns/diff.c
lib/dns/dispatch.c
lib/dns/dnsrps.c
lib/dns/dnstap.c
lib/dns/ds.c
lib/dns/ecs.c
lib/dns/hmac_link.c
lib/dns/journal.c
lib/dns/keymgr.c
lib/dns/master.c
lib/dns/masterdump.c
lib/dns/message.c
lib/dns/name.c
lib/dns/opensslecdsa_link.c
lib/dns/opensslrsa_link.c
lib/dns/peer.c
lib/dns/pkcs11ecdsa_link.c
lib/dns/pkcs11eddsa_link.c
lib/dns/pkcs11rsa_link.c
lib/dns/rbtdb.c
lib/dns/rdata/generic/amtrelay_260.c
lib/dns/rdata/generic/loc_29.c
lib/dns/rdata/in_1/svcb_64.c
lib/dns/resolver.c
lib/dns/rpz.c
lib/dns/rrl.c
lib/dns/sdb.c
lib/dns/sdlz.c
lib/dns/ssu.c
lib/dns/tests/dnstest.c
lib/dns/tests/geoip_test.c
lib/dns/tsec.c
lib/dns/update.c
lib/dns/validator.c
lib/dns/xfrin.c
lib/dns/zone.c
lib/irs/getnameinfo.c
lib/isc/app.c
lib/isc/assertions.c
lib/isc/include/isc/assertions.h
lib/isc/include/isc/util.h
lib/isc/log.c
lib/isc/mem.c
lib/isc/netaddr.c
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tcp.c
lib/isc/netmgr/tcpdns.c
lib/isc/netmgr/udp.c
lib/isc/rwlock.c
lib/isc/siphash.c
lib/isc/sockaddr.c
lib/isc/unix/interfaceiter.c
lib/isc/unix/net.c
lib/isc/unix/socket.c
lib/isc/url.c
lib/isc/win32/include/isc/stdatomic.h
lib/isc/win32/interfaceiter.c
lib/isccc/sexpr.c
lib/isccfg/aclconf.c
lib/isccfg/namedconf.c
lib/isccfg/parser.c
lib/ns/client.c
lib/ns/query.c
lib/ns/tests/nstest.c
lib/ns/tests/query_test.c
lib/ns/xfrout.c

index a46c066c1f06aeccfb2926c7ad49f48dc6de7267..8fcfafa0388c78bcc70bfb5da737bbf7ba550501 100644 (file)
@@ -306,8 +306,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                        zone_options &= ~DNS_ZONEOPT_CHECKDUPRR;
                        zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                zone_options |= DNS_ZONEOPT_CHECKDUPRR;
@@ -326,8 +325,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                        zone_options &= ~DNS_ZONEOPT_CHECKMX;
                        zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                zone_options |= DNS_ZONEOPT_CHECKMX;
@@ -357,8 +355,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                        zone_options |= DNS_ZONEOPT_WARNMXCNAME;
                        zone_options |= DNS_ZONEOPT_IGNOREMXCNAME;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                zone_options |= DNS_ZONEOPT_WARNMXCNAME;
@@ -377,8 +374,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                        zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
                        zone_options |= DNS_ZONEOPT_IGNORESRVCNAME;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
@@ -401,8 +397,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
                        zone_options &= ~DNS_ZONEOPT_CHECKSPF;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                zone_options |= DNS_ZONEOPT_CHECKSPF;
@@ -420,8 +415,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                        zone_options &= ~DNS_ZONEOPT_CHECKNAMES;
                        zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                zone_options |= DNS_ZONEOPT_CHECKNAMES;
@@ -439,8 +433,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                } else if (strcasecmp(masterformatstr, "map") == 0) {
                        masterformat = dns_masterformat_map;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
index 53257a424ec317f17151dd7569b685fc5f57e1cc..ff3f38f75e013103a6d8d4f3e471d64f46ca5538 100644 (file)
@@ -146,8 +146,7 @@ main(int argc, char **argv) {
        } else if (PROGCMP("named-compilezone")) {
                progmode = progmode_compile;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /* Compilation specific defaults */
index 701114b659239a6f99e6f5796bbf08d28301c63f..3a10fce33f0ab27c39324f710872faaf837f8b3d 100644 (file)
@@ -131,8 +131,7 @@ main(int argc, char **argv) {
        } else if (PROGCMP("ddns-confgen")) {
                progmode = progmode_confgen;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc_commandline_errprint = false;
index 1cd88742b1c2059100d0348cc57e9694cf75b087..d1ef0fa1faa36c13fc672fc8ddb5e84280e4b640 100644 (file)
@@ -1332,7 +1332,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
                case 'h':
                        usage();
                        exit(0);
-               /* NOTREACHED */
+                       UNREACHABLE();
                case 'i':
                        no_sigs = true;
                        root_validation = false;
@@ -1343,10 +1343,9 @@ dash_option(char *option, char *next, bool *open_type_class) {
                case 'v':
                        fputs("delv " VERSION "\n", stderr);
                        exit(0);
-               /* NOTREACHED */
+                       UNREACHABLE();
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                if (strlen(option) > 1U) {
                        option = &option[1];
@@ -1484,7 +1483,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
                fprintf(stderr, "Invalid option: -%s\n", option);
                usage();
        }
-       /* NOTREACHED */
+       UNREACHABLE();
        return (false);
 }
 
index 7648448d344c0a4339390d5f2e5ab5807675144d..ceeb5bd99d835cd2134b46474c228a243c2d3fc0 100644 (file)
@@ -1874,7 +1874,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
                                have_ipv6 = false;
                        } else {
                                fatal("can't find IPv4 networking");
-                               /* NOTREACHED */
+                               UNREACHABLE();
                                return (false);
                        }
                        break;
@@ -1884,7 +1884,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
                                have_ipv4 = false;
                        } else {
                                fatal("can't find IPv6 networking");
-                               /* NOTREACHED */
+                               UNREACHABLE();
                                return (false);
                        }
                        break;
@@ -2135,7 +2135,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
                fprintf(stderr, "Invalid option: -%s\n", option);
                usage();
        }
-       /* NOTREACHED */
+       UNREACHABLE();
        return (false);
 }
 
index 6b36c36dad9bb15e69878dc9563489702ef1caf5..02224546a3cb35f4ad6600cb9a63afc9fca533f1 100644 (file)
@@ -2428,8 +2428,7 @@ setup_lookup(dig_lookup_t *lookup) {
                                memmove(addr, &sin6->sin6_addr, addrl);
                                break;
                        default:
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
 
                        isc_buffer_init(&b, ecsbuf, sizeof(ecsbuf));
index dbafd2e421d5b0af4fe3492d364b9ff2f0e0cee8..9e0e8d4d4a835c8e9c9b2326a87de21041dde28d 100644 (file)
@@ -638,7 +638,7 @@ main(int argc, char **argv) {
                dns_secalg_format(alg, algstr, sizeof(algstr));
                fatal("failed to get key %s/%s: %s", namestr, algstr,
                      isc_result_totext(ret));
-               /* NOTREACHED */
+               UNREACHABLE();
                exit(-1);
        }
 
index 6b210e365e7b9e5c1f8a7b96b3a217165700a546..22cf9a4c4dbd50133ac7b0e83d474e016e4c6f92 100644 (file)
@@ -463,7 +463,7 @@ expecttofindkey(dns_name_t *name) {
        dns_name_format(name, namestr, sizeof(namestr));
        fatal("failure looking for '%s DNSKEY' in database: %s", namestr,
              isc_result_totext(result));
-       /* NOTREACHED */
+       UNREACHABLE();
        return (false); /* removes a warning */
 }
 
index 88850b7d6b91d044d3bd1bea120d38321f0f3236..7856159b52c046889dad4dba0ff5fb408873c26c 100644 (file)
@@ -220,7 +220,7 @@ time_units(isc_stdtime_t offset, char *suffix, const char *str) {
                default:
                        fatal("time value %s is invalid", str);
                }
-               /* NOTREACHED */
+               UNREACHABLE();
                break;
        case 'W':
        case 'w':
@@ -238,7 +238,7 @@ time_units(isc_stdtime_t offset, char *suffix, const char *str) {
        default:
                fatal("time value %s is invalid", str);
        }
-       /* NOTREACHED */
+       UNREACHABLE();
        return (0); /* silence compiler warning */
 }
 
index a13cb680030d255ffc0831afe4eda2492cb15f60..0b8522cbbfda53b4e6460091684cbf555f2a767a 100644 (file)
@@ -449,8 +449,7 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
        } else if (strcasecmp(str, "redirect") == 0) {
                ztype = dns_zone_redirect;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (ztype);
 }
@@ -1059,8 +1058,7 @@ named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
                        *name = dns_tsig_hmacsha512_name;
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
        if (typep != NULL) {
index 12becc2f5eb6773e2b5bd6b0c616e91d84584269..2b52e5e689107c8c3a297541f4ab2bd1c2499936 100644 (file)
@@ -161,8 +161,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
                        maxoffset = 0x7fffffffffffffffULL;
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                type = ISC_LOG_TOFILE;
index e481e9f7c41cc5e8f4b55dda143e8eebe80ab6ba..12a048a0a5abaad243679f58cc7b5e8a1cdb6fc1 100644 (file)
@@ -865,8 +865,7 @@ ta_fromconfig(const cfg_obj_t *key, bool *initialp, const char **namestrp,
                break;
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        return (ISC_R_SUCCESS);
@@ -1274,8 +1273,7 @@ get_view_querysource_dispatch(const cfg_obj_t **maps, int af,
                INSIST(result == ISC_R_SUCCESS);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        sa = *(cfg_obj_assockaddr(obj));
@@ -1297,8 +1295,7 @@ get_view_querysource_dispatch(const cfg_obj_t **maps, int af,
                result = isc_net_probeipv6();
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        if (result != ISC_R_SUCCESS) {
                return (ISC_R_SUCCESS);
@@ -1425,8 +1422,7 @@ configure_order(dns_order_t *order, const cfg_obj_t *ent) {
        } else if (!strcasecmp(str, "none")) {
                mode = DNS_RDATASETATTR_NONE;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
@@ -1582,8 +1578,7 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
                } else if (strcasecmp(str, "one-answer") == 0) {
                        CHECK(dns_peer_settransferformat(peer, dns_one_answer));
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -2952,7 +2947,7 @@ catz_create_chg_task(dns_catz_entry_t *entry, dns_catz_zone_t *origin,
                break;
        default:
                REQUIRE(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        event = (catz_chgzone_event_t *)isc_event_allocate(
@@ -4268,8 +4263,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
        } else if (strcasecmp(str, "ignore") == 0) {
                view->checknames = false;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        obj = NULL;
@@ -4739,8 +4733,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
                        } else if (strcasecmp(resp, "fail") == 0) {
                                r = DNS_R_SERVFAIL;
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
 
                        dns_resolver_setquotaresponse(view->resolver,
@@ -5130,8 +5123,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
                } else if (strcasecmp(str, "no-auth-recursive") == 0) {
                        view->minimalresponses = dns_minimal_noauthrec;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -5144,8 +5136,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
        } else if (strcasecmp(str, "one-answer") == 0) {
                view->transfer_format = dns_one_answer;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        obj = NULL;
@@ -5457,8 +5448,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
                } else if (strcasecmp(resp, "fail") == 0) {
                        r = DNS_R_SERVFAIL;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                dns_resolver_setquotaresponse(view->resolver,
@@ -5689,8 +5679,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
                        } else if (strcasecmp(levelstr, "none") == 0) {
                                statlevel = dns_zonestat_none;
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                }
 
@@ -6145,8 +6134,7 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view,
                        } else if (strcasecmp(forwardstr, "only") == 0) {
                                fwdpolicy = dns_fwdpolicy_only;
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                }
        }
@@ -9413,8 +9401,7 @@ load_configuration(const char *filename, named_server_t *server,
        } else if (strcasecmp(cfg_obj_asstring(obj), "aes") == 0) {
                server->sctx->cookiealg = ns_cookiealg_aes;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        obj = NULL;
@@ -13221,8 +13208,7 @@ newzone_parse(named_server_t *server, char *command, dns_view_t **viewp,
        } else if (strncasecmp(command, "mod", 3) == 0) {
                bn = "modzone";
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
@@ -15917,8 +15903,7 @@ named_server_mkeys(named_server_t *server, isc_lex_t *lex,
                        CHECK(mkey_destroy(server, view, text));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                if (viewtxt != NULL) {
index e0599d80e9430451ed4c51355204dc6407c163b8..d734c7a851a8824ef06b33e5fcfec66a97a13222 100644 (file)
@@ -133,8 +133,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
                aclname = "allow-update-forwarding";
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /* First check to see if ACL is defined within the zone */
@@ -249,8 +248,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
                } else if (strcasecmp(str, "deny") == 0) {
                        grant = false;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                str = cfg_obj_asstring(matchtype);
@@ -749,8 +747,7 @@ checknames(dns_zonetype_t ztype, const cfg_obj_t **maps,
                result = named_checknames_get(maps, primary_synonyms, objp);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        INSIST(result == ISC_R_SUCCESS && objp != NULL && *objp != NULL);
@@ -1036,8 +1033,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                                    "masterfile-format: format 'map' is "
                                    "deprecated");
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -1060,8 +1056,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(masterstylestr, "relative") == 0) {
                        masterstyle = &dns_master_style_default;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -1161,8 +1156,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(dialupstr, "passive") == 0) {
                        dialup = dns_dialuptype_passive;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
        if (raw != NULL) {
@@ -1188,8 +1182,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(levelstr, "none") == 0) {
                        statlevel = dns_zonestat_none;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
        dns_zone_setstatlevel(zone, statlevel);
@@ -1268,8 +1261,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                        {
                                notifytype = dns_notifytype_masteronly;
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                }
                notifytype = process_notifytype(notifytype, ztype, zname,
@@ -1463,8 +1455,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
                        fail = check = false;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                if (raw != NULL) {
                        dns_zone_setoption(raw, DNS_ZONEOPT_CHECKNAMES, check);
@@ -1498,8 +1489,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
                        check = false;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                dns_zone_setoption(zone, DNS_ZONEOPT_CHECKSPF, check);
 
@@ -1699,8 +1689,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                        } else if (strcasecmp(arg, "off") == 0) {
                                /* Default */
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                        dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, allow);
                        dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, false);
@@ -1776,8 +1765,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(dupcheck, "ignore") == 0) {
                        fail = check = false;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRR, check);
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRRFAIL, fail);
@@ -1793,8 +1781,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
                        fail = check = false;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMX, check);
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMXFAIL, fail);
@@ -1833,8 +1820,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
                        warn = ignore = true;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNMXCNAME, warn);
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_IGNOREMXCNAME, ignore);
@@ -1850,8 +1836,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
                        warn = ignore = true;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNSRVCNAME, warn);
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_IGNORESRVCNAME,
@@ -1874,8 +1859,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                        } else if (strcasecmp(arg, "maintain") == 0) {
                                /* Default */
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                }
 
index 2d2b4eecabca4d57025559429bdc4457d7adee5c..c3c5a461700a435dffa6aaf1881cbb8fad81b97a 100644 (file)
@@ -83,8 +83,7 @@ main(int argc, char **argv) {
 #ifdef USE_DNSRPS
                        printf("%s\n", librpz->dnsrpzd_path);
 #else  /* ifdef USE_DNSRPS */
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
 #endif /* ifdef USE_DNSRPS */
                        return (0);
 
@@ -134,8 +133,7 @@ main(int argc, char **argv) {
                        librpz->client_detach(&client);
                        printf("%u\n", serial);
 #else  /* ifdef USE_DNSRPS */
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
 #endif /* ifdef USE_DNSRPS */
                        return (0);
 
index e432b989f95b836f51997096270b3edd156088b0..63cf93b805695d695885385f17405f81a72e063f 100644 (file)
@@ -58,7 +58,7 @@ fromhex(char c) {
 
        fprintf(stderr, "bad input format: %02x\n", c);
        exit(3);
-       /* NOTREACHED */
+       UNREACHABLE();
 }
 
 static void
index bdf1259d7d44dc77c8e2a444277aeb6b73767547..2f3cc2ca1cb34df4aff37b532255a3cbb2dd523f 100644 (file)
@@ -1701,7 +1701,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
                                have_ipv6 = false;
                        } else {
                                fatal("can't find IPv4 networking");
-                               /* NOTREACHED */
+                               UNREACHABLE();
                                return (false);
                        }
                        break;
@@ -1712,7 +1712,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
                                have_ipv4 = false;
                        } else {
                                fatal("can't find IPv6 networking");
-                               /* NOTREACHED */
+                               UNREACHABLE();
                                return (false);
                        }
                        break;
@@ -1820,7 +1820,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
                fprintf(stderr, "Invalid option: -%s\n", option);
                usage();
        }
-       /* NOTREACHED */
+       UNREACHABLE();
        return (false);
 }
 
index 0cc368a5164ccb64775379a7b1d7a7955c7e6ea3..100f1a0abe16839dc8ab9846a097b474150ed56a 100644 (file)
@@ -1,6 +1,13 @@
 @@
 @@
 
-    INSIST(0);
-+   ISC_UNREACHABLE();
-    ... when != ISC_UNREACHABLE();
+-   INSIST(0);
++   UNREACHABLE();
+    ... when != UNREACHABLE();
+
+@@
+@@
+
+-   INSIST(0);
+-   ISC_UNREACHABLE();
++   UNREACHABLE();
index 9edcffe9ce1f0b691c0a124f886b16fba1694659..3cb3ee1106df5db898c9aa2a073ad66f286cef23 100644 (file)
@@ -699,7 +699,7 @@ fnmatch(const char *pattern, const char *string, int flags) {
                        break;
                }
        }
-       /* NOTREACHED */
+       UNREACHABLE();
 }
 
 static int
index a2d69b41f2d359df4e92f2edcc66e524bd8e3ef8..f4308aefcdd39ac31b3bcbec66fb5d4582c67d10 100644 (file)
@@ -143,12 +143,10 @@ Good:
        static char *   c              /* Description of 'c'. */
 
 
-The following lint and lint-like comments should be used where appropriate:
+The following macros should be used where appropriate:
 
-       /* ARGSUSED */
        FALLTHROUGH;
-       /* NOTREACHED */
-       /* VARARGS */
+       UNREACHABLE();
 
 #### Header files
 
index d2cc4bf8921b511f32ced67f6dc2160ee4207399..3e1a5d6e0a4abd0d2e5e5a65b1c4cc492071e896 100644 (file)
@@ -2164,8 +2164,7 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
                        }
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                for (element2 = cfg_list_first(typelist); element2 != NULL;
@@ -2545,8 +2544,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                        break;
 
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -3177,7 +3175,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                                    "masterfile-format: format 'map' is "
                                    "deprecated");
                } else {
-                       INSIST(0);
+                       UNREACHABLE();
                        ISC_UNREACHABLE();
                }
        }
index c257aeeaadf82ba4df88bb67d4f84ab990e1b1c8..9359e532cc5b1122e8c89996380a120cfee01212 100644 (file)
@@ -405,8 +405,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
                return (dns_geoip_match(reqaddr, env->geoip, &e->geoip_elem));
 #endif /* if defined(HAVE_GEOIP2) */
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        result = dns_acl_match(reqaddr, reqsigner, inner, env, &indirectmatch,
@@ -587,8 +586,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
                        return (true);
 
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
index 42241f45a2f11d13f358193332244c8ade0c4e2f..1972d0e2cce655c4449db8467ef1fc7ebb81796c 100644 (file)
@@ -219,7 +219,7 @@ getudpdispatch(int family, dns_dispatchmgr_t *dispatchmgr,
                attrs |= DNS_DISPATCHATTR_IPV6;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
        attrmask = 0;
index 823bd2eecc5e5c66d3609bba5abd2bff125a8391..45d4437672e9aab868a82876d75581cbd15ad10d 100644 (file)
@@ -372,8 +372,7 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
                                                                 &ardataset);
                                break;
                        default:
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
 
                        if (result == ISC_R_SUCCESS) {
index 419366d754ef78ebd668e0b355457e538863ff7d..347d47dccf3b805837046de13aa5861ae1952bd5 100644 (file)
@@ -915,7 +915,7 @@ free_buffer(dns_dispatch_t *disp, void *buf, unsigned int len) {
                isc_mem_put(disp->mgr->mctx, buf, buffersize);
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 }
@@ -1586,7 +1586,7 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
                disp->recv_pending = 1;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
index 4d481aa720451acd519fd010b619a309793e6a80..faab092551f123f935ac7092d8e6fe3d015f63d0 100644 (file)
@@ -310,8 +310,7 @@ dns_dnsrps_2policy(librpz_policy_t rps_policy) {
        case LIBRPZ_POLICY_GIVEN:
        case LIBRPZ_POLICY_DISABLED:
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 077a3c71aa03581f06bb3fdfcc48c1eff94cd01e..30ca97e636a5cae796774d89386c40357e0e6cc4 100644 (file)
@@ -635,8 +635,7 @@ dnstap_type(dns_dtmsgtype_t msgtype) {
        case DNS_DTTYPE_UR:
                return (DNSTAP__MESSAGE__TYPE__UPDATE_RESPONSE);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -985,8 +984,7 @@ dns_dt_open(const char *filename, dns_dtmode_t mode, isc_mem_t *mctx,
                result = ISC_R_NOTIMPLEMENTED;
                goto cleanup;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc_mem_attach(mctx, &handle->mctx);
index d6d46b8f8317cd9fd8fc555941610d4834e36d6f..feb73a76fcd3707dd27fece3b0c672647b53afc6 100644 (file)
@@ -63,8 +63,7 @@ dns_ds_fromkeyrdata(const dns_name_t *owner, dns_rdata_t *key,
                break;
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        name = dns_fixedname_initname(&fname);
index ae88c4713e1e7b675ffe29b73da50ad59347fe0c..8dbf720f64ea1f7368165a744a0c0c48c8f1bcd1 100644 (file)
@@ -66,8 +66,7 @@ dns_ecs_equals(const dns_ecs_t *ecs1, const dns_ecs_t *ecs2) {
                addr2 = (const unsigned char *)&ecs2->addr.type.in6;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
index ea0cc1006be2965f89fffbb797fc5d5b1f65c9e7..0886b9f2f29804574a6c656401bec699c5ff4046 100644 (file)
@@ -375,8 +375,7 @@ hmac__get_tag_key(const isc_md_type_t *type) {
        } else if (type == ISC_MD_SHA512) {
                return (TAG_HMACSHA512_KEY);
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -395,8 +394,7 @@ hmac__get_tag_bits(const isc_md_type_t *type) {
        } else if (type == ISC_MD_SHA512) {
                return (TAG_HMACSHA512_BITS);
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -448,8 +446,7 @@ hmac__to_dst_alg(const isc_md_type_t *type) {
        } else if (type == ISC_MD_SHA512) {
                return (DST_ALG_HMACSHA512);
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 69beef7fbb3af4141c5682ae35b8a38b5e76fdbf..438f938f2d37e8d600253c5a3b4cfdbdbec9854e 100644 (file)
@@ -824,8 +824,7 @@ ixfr_order(const void *av, const void *bv) {
                aop = 0;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        switch (b->op) {
@@ -838,8 +837,7 @@ ixfr_order(const void *av, const void *bv) {
                bop = 0;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        r = bop - aop;
index e73e837459c8738c1aee50d383effcacbbcee253..965782b1f3858c3a7c96b8fe30c83b5ad74f476d 100644 (file)
@@ -1367,8 +1367,7 @@ keymgr_transition_time(dns_dnsseckey_t *key, int type,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
                break;
        }
 
index 8019cae569b084c119021f3c4604d50f74085e3e..80efd0e0f7e1d99b1dba9cb18ea45b54c6949ee6 100644 (file)
@@ -550,8 +550,7 @@ loadctx_create(dns_masterformat_t format, isc_mem_t *mctx, unsigned int options,
                lctx->load = load_map;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (lex != NULL) {
index 84180554338869bab3ff164ce576fedc58329837..96de40b23bb314a30caa75e4f4e20ccdc023a79e 100644 (file)
@@ -1600,8 +1600,7 @@ dumpctx_create(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
                dctx->dumpsets = dump_rdatasets_map;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        result = totext_ctx_init(style, NULL, &dctx->tctx);
@@ -1722,8 +1721,7 @@ writeheader(dns_dumpctx_t *dctx) {
 
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc_mem_put(dctx->mctx, buffer.base, buffer.length);
index 98feb582c8cc20d08eca6a6a78d3697a523fe2a3..d7be0b95cc4a8746800da1f71aa9c0efd9edbbb0 100644 (file)
@@ -898,8 +898,7 @@ getname(dns_name_t *name, isc_buffer_t *source, dns_message_t *msg,
                }
        }
 
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 }
 
 static isc_result_t
index 63310ae4df32a6a46ec3fbc1febda531838941d3..5233eedbd30b65971f0f981708c9f25f6101ecc0 100644 (file)
@@ -1475,7 +1475,7 @@ dns_name_totext2(const dns_name_t *name, unsigned int options,
                } else {
                        FATAL_ERROR(__FILE__, __LINE__,
                                    "Unexpected label type %02x", count);
-                       /* NOTREACHED */
+                       UNREACHABLE();
                }
 
                /*
@@ -1599,7 +1599,7 @@ dns_name_tofilenametext(const dns_name_t *name, bool omit_final_dot,
                } else {
                        FATAL_ERROR(__FILE__, __LINE__,
                                    "Unexpected label type %02x", count);
-                       /* NOTREACHED */
+                       UNREACHABLE();
                }
 
                /*
index 25f2b5d465021f02baf6912780e3ad39cf5a3d9f..1f16ca7073861e7f2fc68bc8146cb936b448cc15 100644 (file)
@@ -657,8 +657,7 @@ dst__key_to_eckey(dst_key_t *key, EC_KEY **eckey) {
                group_nid = NID_secp384r1;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        *eckey = EC_KEY_new_by_curve_name(group_nid);
        if (*eckey == NULL) {
index 1d29d944328c10a1f0379063cf0cead5896bc9f4..657a25341719fe2dcb720f5a75be4facc6dd7864 100644 (file)
@@ -220,8 +220,7 @@ opensslrsa_createctx(dst_key_t *key, dst_context_t *dctx) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        evp_md_ctx = EVP_MD_CTX_create();
@@ -241,8 +240,7 @@ opensslrsa_createctx(dst_key_t *key, dst_context_t *dctx) {
                type = EVP_sha512();
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (!EVP_DigestInit_ex(evp_md_ctx, type, NULL)) {
@@ -483,8 +481,7 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (rsa == NULL || e == NULL || cb == NULL) {
index 320cc01dfdb86f490aca7019e426cec8daff4c3a..d54bc4d3d3e09775a0eda34eb897a78901565528 100644 (file)
@@ -200,8 +200,7 @@ dns_peer_new(isc_mem_t *mem, const isc_netaddr_t *addr, dns_peer_t **peerptr) {
                prefixlen = 128;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        return (dns_peer_newprefix(mem, addr, prefixlen, peerptr));
index a1a884663f46901d56b2838fa8863c881d925a7e..9e0d5320aad13c0515256540516a69df0627c01e 100644 (file)
@@ -191,7 +191,7 @@ pkcs11ecdsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
                dgstlen = ISC_SHA384_DIGESTLENGTH;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -311,7 +311,7 @@ pkcs11ecdsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
                dgstlen = ISC_SHA384_DIGESTLENGTH;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -453,7 +453,7 @@ pkcs11ecdsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
                attr->ulValueLen = sizeof(PK11_ECC_SECP384R1);           \
                break;                                                   \
        default:                                                         \
-               INSIST(0);                                               \
+               UNREACHABLE();                                           \
                ISC_UNREACHABLE();                                       \
        }
 
@@ -563,7 +563,7 @@ pkcs11ecdsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
                key->key_size = DNS_KEY_ECDSA384SIZE * 4;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -646,7 +646,7 @@ pkcs11ecdsa_todns(const dst_key_t *key, isc_buffer_t *data) {
                len = DNS_KEY_ECDSA384SIZE;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -688,7 +688,7 @@ pkcs11ecdsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
                len = DNS_KEY_ECDSA384SIZE;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -984,7 +984,7 @@ pkcs11ecdsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
                key->key_size = DNS_KEY_ECDSA384SIZE * 4;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -1106,7 +1106,7 @@ pkcs11ecdsa_fromlabel(dst_key_t *key, const char *engine, const char *label,
                key->key_size = DNS_KEY_ECDSA384SIZE * 4;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
index 0c22244d5713cfa1473eb47df7a5ac734c45358a..9979e858e5ca7c6e3e7c40ac619d0009bd7da330 100644 (file)
@@ -150,7 +150,7 @@ pkcs11eddsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
                siglen = DNS_SIG_ED448SIZE;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -425,7 +425,7 @@ pkcs11eddsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
                attr->ulValueLen = sizeof(PK11_ECX_ED448);                     \
                break;                                                         \
        default:                                                               \
-               INSIST(0);                                                     \
+               UNREACHABLE();                                                 \
                ISC_UNREACHABLE();                                             \
        }
 
@@ -535,7 +535,7 @@ pkcs11eddsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
                key->key_size = DNS_KEY_ED448SIZE * 8;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -618,7 +618,7 @@ pkcs11eddsa_todns(const dst_key_t *key, isc_buffer_t *data) {
                len = DNS_KEY_ED448SIZE;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -659,7 +659,7 @@ pkcs11eddsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
                len = DNS_KEY_ED448SIZE;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -954,7 +954,7 @@ pkcs11eddsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
                key->key_size = DNS_KEY_ED448SIZE * 8;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -1076,7 +1076,7 @@ pkcs11eddsa_fromlabel(dst_key_t *key, const char *engine, const char *label,
                key->key_size = DNS_KEY_ED448SIZE * 8;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
index 69eddcf984b54e8ac515d5a8b629f6f1d9d33099..4ae74f3bc5ae9a1798e56a9f581476869013e356 100644 (file)
@@ -113,8 +113,7 @@ pkcs11rsa_createctx_sign(dst_key_t *key, dst_context_t *dctx) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        rsa = key->keydata.pkey;
@@ -229,7 +228,7 @@ token_key:
                mech.mechanism = CKM_SHA512_RSA_PKCS;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -326,8 +325,7 @@ pkcs11rsa_createctx_verify(dst_key_t *key, unsigned int maxbits,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        rsa = key->keydata.pkey;
@@ -388,7 +386,7 @@ pkcs11rsa_createctx_verify(dst_key_t *key, unsigned int maxbits,
                mech.mechanism = CKM_SHA512_RSA_PKCS;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -588,8 +586,7 @@ pkcs11rsa_createctx(dst_key_t *key, dst_context_t *dctx) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        switch (key->key_alg) {
@@ -604,7 +601,7 @@ pkcs11rsa_createctx(dst_key_t *key, dst_context_t *dctx) {
                mech.mechanism = CKM_SHA512;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -732,8 +729,7 @@ pkcs11rsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        switch (key->key_alg) {
@@ -754,7 +750,7 @@ pkcs11rsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
                hashlen = ISC_SHA512_DIGESTLENGTH;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
        dgstlen = derlen + hashlen;
@@ -948,7 +944,7 @@ pkcs11rsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
                hashlen = ISC_SHA512_DIGESTLENGTH;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
        dgstlen = derlen + hashlen;
@@ -1146,7 +1142,7 @@ pkcs11rsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
                }
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
index bd617b4e165c45cd5e6ae1b5038702b6ad56a7ae..93473a5bcda2139c60bbd4ef05f479faed297059 100644 (file)
@@ -4540,7 +4540,7 @@ zone_findzonecut(dns_db_t *db, const dns_name_t *name, unsigned int options,
 
        FATAL_ERROR(__FILE__, __LINE__, "zone_findzonecut() called!");
 
-       /* NOTREACHED */
+       UNREACHABLE();
        return (ISC_R_NOTIMPLEMENTED);
 }
 
index 0e4ddbe33ba0a8ee282e80ce09a3b95afab3f51f..870b29f00448ef78b2981253034cbc71cb9fc97b 100644 (file)
@@ -116,8 +116,7 @@ fromtext_amtrelay(ARGS_FROMTEXT) {
                return (dns_name_fromtext(&name, &buffer, origin, options,
                                          target));
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -178,8 +177,7 @@ totext_amtrelay(ARGS_TOTEXT) {
                return (dns_name_totext(&name, false, target));
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (ISC_R_SUCCESS);
 }
index 0f07e461f74c5d5e165f023cf40d1e3ecccd664d..39afac0261d4130caed4dce963097265a9054071 100644 (file)
@@ -272,8 +272,7 @@ loc_getlatitude(isc_lex_t *lexer, unsigned long *latitude) {
                *latitude = 0x80000000 - (d1 * 3600 + m1 * 60) * 1000 - s1;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        return (ISC_R_SUCCESS);
@@ -294,8 +293,7 @@ loc_getlongitude(isc_lex_t *lexer, unsigned long *longitude) {
                *longitude = 0x80000000 - (d2 * 3600 + m2 * 60) * 1000 - s2;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        return (ISC_R_SUCCESS);
index 1b87e444efdaa4c697c70e4e84b266ac16193446..885d613e10084f84b64769986a67c2599d7d45d2 100644 (file)
@@ -326,8 +326,7 @@ svc_fromtext(isc_textregion_t *region, isc_buffer_t *target) {
                        RETERR(svcsortkeylist(target, used));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                len = isc_buffer_usedlength(target) -
@@ -736,8 +735,7 @@ generic_totext_in_svcb(ARGS_TOTEXT) {
                        }
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
        return (ISC_R_SUCCESS);
index 58a6e2e4e003348b9b35e48c9123a09fa6846a41..7c54c099f6f54e1aea0dea0c529f23c4e463ab08 100644 (file)
@@ -2442,8 +2442,7 @@ addr2buf(void *buf, const size_t bufsize, const isc_sockaddr_t *sockaddr) {
                memmove(buf, &netaddr.type.in6, 16);
                return (16);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (0);
 }
@@ -7448,8 +7447,7 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname,
                RUNTIME_CHECK(result == ISC_R_SUCCESS);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (chainingp != NULL) {
index 180a009e77a2425849debc7becb7cc5c9c3871cc..35e104a912e5f533af82cfb030cd5cb0e28befa1 100644 (file)
@@ -280,8 +280,7 @@ dns_rpz_policy2str(dns_rpz_policy_t policy) {
                str = "DNS64";
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (str);
 }
@@ -345,8 +344,7 @@ make_addr_set(dns_rpz_addr_zbits_t *tgt_set, dns_rpz_zbits_t zbits,
                tgt_set->nsip = zbits;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -363,8 +361,7 @@ make_nm_set(dns_rpz_nm_zbits_t *tgt_set, dns_rpz_num_t rpz_num,
                tgt_set->ns = DNS_RPZ_ZBIT(rpz_num);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -619,8 +616,7 @@ adj_trigger_cnt(dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (inc) {
@@ -2672,8 +2668,7 @@ dns_rpz_find_ip(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type,
                rpz_num = zbit_to_num(found->set.nsip & tgt_set.nsip);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        result = ip2name(&found->ip, found->prefix, dns_rootname, ip_name);
        RWUNLOCK(&rpzs->search_lock, isc_rwlocktype_read);
index 8d217b5cd8657cf4ea9ecd1b3f96cbd1b427de78..c00fe788d568964c1738e2e1aa7d2bffcd708981 100644 (file)
@@ -482,8 +482,7 @@ get_rate(dns_rrl_t *rrl, dns_rrl_rtype_t rtype) {
        case DNS_RRL_RTYPE_ALL:
                return (&rrl->all_per_second);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -852,8 +851,7 @@ make_log_buf(dns_rrl_t *rrl, dns_rrl_entry_t *e, const char *str1,
                ADD_LOG_CSTR(&lb, "slip ");
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        switch (e->key.s.rtype) {
@@ -881,8 +879,7 @@ make_log_buf(dns_rrl_t *rrl, dns_rrl_entry_t *e, const char *str1,
                ADD_LOG_CSTR(&lb, "all ");
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (plural) {
index 8ae2275ae77e78b774e2c74d4f4d6405318238b3..720b8ba9b99846dd117dd340010d0bec251093b4 100644 (file)
@@ -1069,8 +1069,7 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
        UNUSED(db);
        UNUSED(node);
        UNUSED(now);
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 }
 
 static void
index 29864a94e47d048084d3bf57bd755d21a3b74b4d..6d4aa6a0838a0f7d65f471be51ff9a5c2400d671 100644 (file)
@@ -736,8 +736,7 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
        UNUSED(db);
        UNUSED(node);
        UNUSED(now);
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 }
 
 static void
index 78615681a9592b57edf562d03592a21ea00e854c..256758b0fe938b843d28d55049747f08c6946b0a 100644 (file)
@@ -231,8 +231,7 @@ reverse_from_address(dns_name_t *tcpself, const isc_netaddr_t *tcpaddr) {
                RUNTIME_CHECK(result < sizeof(buf));
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        isc_buffer_init(&b, buf, strlen(buf));
        isc_buffer_add(&b, strlen(buf));
@@ -273,8 +272,7 @@ stf_from_address(dns_name_t *stfself, const isc_netaddr_t *tcpaddr) {
                RUNTIME_CHECK(result < sizeof(buf));
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        isc_buffer_init(&b, buf, strlen(buf));
        isc_buffer_add(&b, strlen(buf));
index bff0da6801a5949528014029414d29a0fff27f70..77045be1719b882afb2a5f8221cb39cd592962b2 100644 (file)
@@ -383,7 +383,7 @@ fromhex(char c) {
 
        printf("bad input format: %02x\n", c);
        exit(3);
-       /* NOTREACHED */
+       UNREACHABLE();
 }
 
 /*
index 2a10e8479ce091b30ae1b0fc2492c528761cfc7e..054213ec942fa8ba9412265cb00dadd09f59074d 100644 (file)
@@ -122,8 +122,7 @@ entry_exists(dns_geoip_subtype_t subtype, const char *addr) {
        } else if (inet_pton(AF_INET, addr, &in4) == 1) {
                isc_netaddr_fromin(&na, &in4);
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        db = geoip2_database(&geoip, fix_subtype(&geoip, subtype));
index 897e7a65c46ff640f2691d71ca4b573749c22dbe..249a2ea927a122e803b0114204e4afac1b1d25a9 100644 (file)
@@ -93,8 +93,7 @@ dns_tsec_create(isc_mem_t *mctx, dns_tsectype_t type, dst_key_t *key,
                tsec->ukey.key = key;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        tsec->magic = DNS_TSEC_MAGIC;
@@ -120,8 +119,7 @@ dns_tsec_destroy(dns_tsec_t **tsecp) {
                dst_key_free(&tsec->ukey.key);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        tsec->magic = 0;
@@ -148,7 +146,6 @@ dns_tsec_getkey(dns_tsec_t *tsec, void *keyp) {
                *(dst_key_t **)keyp = tsec->ukey.key;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
index 9e53dbbc6e0190d13c710942693fe058ef542e16..f1849799c772f012f9613b8150567aeea5dbedd6 100644 (file)
@@ -1971,8 +1971,7 @@ next_state:
                                               state->keyset_kskonly));
                                sigs++;
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                        ISC_LIST_UNLINK(state->nsec_mindiff.tuples, t, link);
                        ISC_LIST_APPEND(state->work.tuples, t, link);
@@ -2146,8 +2145,7 @@ next_state:
                                               state->keyset_kskonly));
                                sigs++;
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                        ISC_LIST_UNLINK(state->nsec_mindiff.tuples, t, link);
                        ISC_LIST_APPEND(state->work.tuples, t, link);
@@ -2174,8 +2172,7 @@ next_state:
                INSIST(ISC_LIST_EMPTY(state->nsec_mindiff.tuples));
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
 failure:
@@ -2235,8 +2232,7 @@ dns__update_soaserial(uint32_t serial, dns_updatemethod_t method) {
                }
                return (serial);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2267,8 +2263,7 @@ dns_update_soaserial(uint32_t serial, dns_updatemethod_t method,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (used != NULL) {
index 0ab877ecb16b87118378f9455df6a5ece8392f0c..e1759d2396e651410577fba9087e357cebba4bf7 100644 (file)
@@ -3085,8 +3085,7 @@ validator_start(isc_task_t *task, isc_event_t *event) {
 
                result = validate_nx(val, false);
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (result != DNS_R_WAIT) {
index a55913597e83f061c84502f4c8b4abf4a04bc973..c649041801f0c1245d788cb4c789ee7a422d8aa2 100644 (file)
@@ -684,8 +684,7 @@ redo:
                FAIL(DNS_R_EXTRADATA);
                FALLTHROUGH;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        result = ISC_R_SUCCESS;
 failure:
index 1afea64383d34b17b4ae426dc9f9f86210a47706..bc9c564f576cb49ea9eeff22890a8e197c0c9a83 100644 (file)
@@ -10084,8 +10084,7 @@ normalize_key(dns_rdata_t *rr, dns_rdata_t *target, unsigned char *data,
                                     &dnskey, &buf);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (ISC_R_SUCCESS);
 }
@@ -18011,8 +18010,7 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        UNLOCK_ZONE(zone);
        INSIST(isc_sockaddr_pf(&masteraddr) == isc_sockaddr_pf(&sourceaddr));
@@ -19783,8 +19781,7 @@ dns_zone_setdialup(dns_zone_t *zone, dns_dialuptype_t dialup) {
                DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NOREFRESH);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        UNLOCK_ZONE(zone);
 }
@@ -19866,8 +19863,7 @@ dns_zonemgr_getcount(dns_zonemgr_t *zmgr, int state) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        RWUNLOCK(&zmgr->rwlock, isc_rwlocktype_read);
index 11da8c6cf314b561ec752aa371083c91edd3eab5..8c6fe82f6b6f342330fea8c4f667326527a7cfbd 100644 (file)
@@ -206,7 +206,7 @@ found:
                break;
 
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
        proto = ((flags & NI_DGRAM) != 0) ? "udp" : "tcp";
index 6cfef17cf1a80d813e22cb4e03c70665c2584b87..69fba9e0df93896c7b685e7937763dd3be9c8ccf 100644 (file)
@@ -323,8 +323,7 @@ isc_app_ctxrun(isc_appctx_t *ctx) {
                                                             true);
                                        break;
                                default:
-                                       INSIST(0);
-                                       ISC_UNREACHABLE();
+                                       UNREACHABLE();
                                }
                        }
                } else {
index 06b50ea405fe255a80d70fa3693bc234968c3e0d..1f16fb3bcc624bcc26a6d78c6d0949cbd76c7e29 100644 (file)
@@ -47,7 +47,6 @@ isc_assertion_failed(const char *file, int line, isc_assertiontype_t type,
                     const char *cond) {
        isc_assertion_failed_cb(file, line, type, cond);
        abort();
-       /* NOTREACHED */
 }
 
 /*% Set callback. */
index 0da2de2d6776358db9929a3b67b975d167e37c39..e68adfab4e4da718a18f123414abac35c8c75a2c 100644 (file)
@@ -69,6 +69,11 @@ isc_assertion_typetotext(isc_assertiontype_t type);
                                        isc_assertiontype_invariant, #cond), \
                 0)))
 
+#define ISC_UNREACHABLE()                                                   \
+       (isc_assertion_failed(__FILE__, __LINE__, isc_assertiontype_insist, \
+                             "unreachable"),                               \
+        __builtin_unreachable())
+
 ISC_LANG_ENDDECLS
 
 #endif /* ISC_ASSERTIONS_H */
index a1622530b62daadb80046407b659f3e17480d90b..f49621a00138485427a234431c3d921c9cf304f5 100644 (file)
  */
 #include <isc/likely.h>
 
-#ifdef HAVE_BUILTIN_UNREACHABLE
-#define ISC_UNREACHABLE() __builtin_unreachable();
-#else /* ifdef HAVE_BUILTIN_UNREACHABLE */
-#define ISC_UNREACHABLE()
-#endif /* ifdef HAVE_BUILTIN_UNREACHABLE */
-
 /* GCC defines __SANITIZE_ADDRESS__, so reuse the macro for clang */
 #if __has_feature(address_sanitizer)
 #define __SANITIZE_ADDRESS__ 1
@@ -275,6 +269,8 @@ mock_assert(const int result, const char *const expression,
        ((!(expression))                                                      \
                 ? (mock_assert(0, #expression, __FILE__, __LINE__), abort()) \
                 : (void)0)
+#define UNREACHABLE() \
+       (mock_assert(0, "unreachable", __FILE__, __LINE__), abort())
 #define _assert_true(c, e, f, l) \
        ((c) ? (void)0 : (_assert_true(0, e, f, l), abort()))
 #define _assert_int_equal(a, b, f, l) \
@@ -299,6 +295,8 @@ mock_assert(const int result, const char *const expression,
 /*% Invariant Assertion */
 #define INVARIANT(e) ISC_INVARIANT(e)
 
+#define UNREACHABLE() ISC_UNREACHABLE()
+
 #else /* CPPCHECK */
 
 /*% Require Assertion */
@@ -318,6 +316,8 @@ mock_assert(const int result, const char *const expression,
        if (!(e))    \
        abort()
 
+#define UNREACHABLE() abort()
+
 #endif /* CPPCHECK */
 
 #endif /* UNIT_TESTING */
index 4bef055f105a11f45251d7e4309659666ef5e8e3..b12e797a048a2dce76560224652e72db46b78ee3 100644 (file)
@@ -706,8 +706,7 @@ isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
                break;
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        ISC_LIST_PREPEND(lcfg->channels, channel, link);
index 37c88bc73abb281018382d15126b533cb1ea4136..d097e2680e390704e247783a3a9132f17186cab5 100644 (file)
@@ -345,8 +345,7 @@ delete_trace_entry(isc__mem_t *mctx, const void *ptr, size_t size,
         * If we get here, we didn't find the item on the list.  We're
         * screwed.
         */
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 }
 #endif /* ISC_MEM_TRACKLINES */
 
@@ -2015,8 +2014,7 @@ isc__mem_checkdestroyed(void) {
                        print_contexts(file);
                }
 #endif /* if ISC_MEM_TRACKLINES */
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        UNLOCK(&contextslock);
 }
index 8f96b58c72ba6cd53ba71b298db47a9373183185..372c294a923387773f0b6ad84b77305149c39003 100644 (file)
@@ -364,8 +364,7 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) {
                break;
 #endif /* ifdef ISC_PLATFORM_HAVESYSUNH */
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 3f07d456ab9c3f8505d0bee5f34fb1efb8c62e67..ef262c500ebec810f9799bf5e164d86a5a4a6160 100644 (file)
@@ -617,8 +617,7 @@ isc__netmgr_destroy(isc_nm_t **netmgrp) {
 #ifdef NETMGR_TRACE
        if (isc_refcount_current(&mgr->references) > 1) {
                isc__nm_dump_active(mgr);
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 #endif
 
@@ -800,8 +799,7 @@ process_all_queues(isc__networker_t *worker) {
                        reschedule = true;
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -879,8 +877,7 @@ isc__nm_async_task(isc__networker_t *worker, isc__netievent_t *ev0) {
        case ISC_R_SUCCESS:
                return;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -989,8 +986,7 @@ process_netievent(isc__networker_t *worker, isc__netievent_t *ievent) {
                NETIEVENT_CASE(resume);
                NETIEVENT_CASE_NOMORE(pause);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (true);
 }
@@ -1886,8 +1882,7 @@ isc__nm_failed_read_cb(isc_nmsocket_t *sock, isc_result_t result, bool async) {
                isc__nm_tcpdns_failed_read_cb(sock, result);
                return;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2098,8 +2093,7 @@ isc__nm_alloc_cb(uv_handle_t *handle, size_t size, uv_buf_t *buf) {
                buf->len = ISC_NETMGR_TCP_RECVBUF_SIZE;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        REQUIRE(buf->len <= ISC_NETMGR_RECVBUF_SIZE);
@@ -2133,8 +2127,7 @@ isc__nm_start_reading(isc_nmsocket_t *sock) {
                UV_RUNTIME_CHECK(uv_read_start, r);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        sock->reading = true;
 }
@@ -2158,8 +2151,7 @@ isc__nm_stop_reading(isc_nmsocket_t *sock) {
                UV_RUNTIME_CHECK(uv_read_stop, r);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        sock->reading = false;
 }
@@ -2182,8 +2174,7 @@ processbuffer(isc_nmsocket_t *sock) {
        case isc_nm_tcpdnssocket:
                return (isc__nm_tcpdns_processbuffer(sock));
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2424,8 +2415,7 @@ isc_nm_send(isc_nmhandle_t *handle, isc_region_t *region, isc_nm_cb_t cb,
                isc__nm_tcpdns_send(handle, region, cb, cbarg);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2451,8 +2441,7 @@ isc_nm_read(isc_nmhandle_t *handle, isc_nm_recv_cb_t cb, void *cbarg) {
                isc__nm_tcpdns_read(handle, cb, cbarg);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2471,8 +2460,7 @@ isc_nm_cancelread(isc_nmhandle_t *handle) {
                isc__nm_tcpdns_cancelread(handle);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2487,8 +2475,7 @@ isc_nm_pauseread(isc_nmhandle_t *handle) {
                isc__nm_tcp_pauseread(handle);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2503,8 +2490,7 @@ isc_nm_resumeread(isc_nmhandle_t *handle) {
                isc__nm_tcp_resumeread(handle);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2523,8 +2509,7 @@ isc_nm_stoplistening(isc_nmsocket_t *sock) {
                isc__nm_tcp_stoplistening(sock);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2703,7 +2688,7 @@ isc__nmsocket_reset(isc_nmsocket_t *sock) {
                break;
        default:
                INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
                break;
        }
 
@@ -2741,8 +2726,7 @@ isc__nmsocket_shutdown(isc_nmsocket_t *sock) {
        case isc_nm_tcpdnslistener:
                return;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -3317,8 +3301,7 @@ nmsocket_type_totext(isc_nmsocket_type type) {
        case isc_nm_tcpdnssocket:
                return ("isc_nm_tcpdnssocket");
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 17f5c76c8ab689d62b967e0d0bb7bc7710200cc8..bfadefc3197a5b70f98433b17690b897b40591a9 100644 (file)
@@ -642,8 +642,7 @@ isc__nm_tcp_stoplistening(isc_nmsocket_t *sock) {
 
        if (!atomic_compare_exchange_strong(&sock->closing, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (!isc__nm_in_netthread()) {
@@ -1156,8 +1155,7 @@ tcp_stop_cb(uv_handle_t *handle) {
 
        if (!atomic_compare_exchange_strong(&sock->closed, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CLOSE]);
@@ -1175,8 +1173,7 @@ tcp_close_sock(isc_nmsocket_t *sock) {
 
        if (!atomic_compare_exchange_strong(&sock->closed, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CLOSE]);
index ae6736f1eabbd097fe53537a7886cdadfa29716a..2e87260f1eadd751d58819df025f3a0c0f174af1 100644 (file)
@@ -608,8 +608,7 @@ isc__nm_tcpdns_stoplistening(isc_nmsocket_t *sock) {
 
        if (!atomic_compare_exchange_strong(&sock->closing, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (!isc__nm_in_netthread()) {
@@ -1188,8 +1187,7 @@ tcpdns_stop_cb(uv_handle_t *handle) {
 
        if (!atomic_compare_exchange_strong(&sock->closed, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CLOSE]);
@@ -1207,8 +1205,7 @@ tcpdns_close_sock(isc_nmsocket_t *sock) {
 
        if (!atomic_compare_exchange_strong(&sock->closed, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CLOSE]);
index ad3695581266653d0095c3c5924a285211764d3a..8a35889b510b6f39ed260a34bd939cbeeecdad8f 100644 (file)
@@ -308,8 +308,7 @@ isc__nm_udp_stoplistening(isc_nmsocket_t *sock) {
 
        if (!atomic_compare_exchange_strong(&sock->closing, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (!isc__nm_in_netthread()) {
@@ -959,8 +958,7 @@ udp_stop_cb(uv_handle_t *handle) {
 
        if (!atomic_compare_exchange_strong(&sock->closed, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CLOSE]);
@@ -981,8 +979,7 @@ udp_close_cb(uv_handle_t *handle) {
 
        if (!atomic_compare_exchange_strong(&sock->closed, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CLOSE]);
index 9b2c90495e7d2b38cc875d7b3bce0cb3c9fc9940..cece662c480d5b21aa44090f1a4282cae342e4c1 100644 (file)
@@ -63,8 +63,7 @@ isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (ISC_R_SUCCESS);
 }
@@ -95,8 +94,7 @@ isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
        case EAGAIN:
                return (ISC_R_LOCKBUSY);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 0f83ef5f2e61c7aab32638b67f147fad3927cac8..1a863ff8e1d36369daf56bef1b0e1a05c91c14b2 100644 (file)
@@ -142,8 +142,7 @@ isc_siphash24(const uint8_t *k, const uint8_t *in, const size_t inlen,
        case 0:
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        v3 ^= b;
@@ -208,8 +207,7 @@ isc_halfsiphash24(const uint8_t *k, const uint8_t *in, const size_t inlen,
        case 0:
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        v3 ^= b;
index df0c8dfde3e739d332624128c3a9421e74851059..16afbd51b96a455ea8a41fa95c921f093ac147ff 100644 (file)
@@ -300,8 +300,7 @@ isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int pf) {
                isc_sockaddr_any6(sockaddr);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -371,8 +370,7 @@ isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
                sockaddr->type.sin6.sin6_port = htons(port);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        ISC_LINK_INIT(sockaddr, link);
 }
index cba23394353a302ecdd14024d89ea0fdc1c1fc0d..a1f6c9de8f6e6daf02c9a44e74475a5bbc904cf6 100644 (file)
@@ -123,8 +123,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index f4dd3e0807176afa2f0009243f053ffa1df57018..09674604768d02ab5621c4a676a76d05c8f3992f 100644 (file)
@@ -508,8 +508,7 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) {
                break;
 #endif /* ifdef IPV6_TCLASS */
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (sendmsg(s, &msg, 0) < 0) {
index 29158414224ab104bdf7aa00c9d1aa17b357063a..1fd53fb0e1291e128bdef4649278e92112c70920 100644 (file)
@@ -1576,7 +1576,7 @@ doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) {
        case isc_sockettype_raw:
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
@@ -2465,7 +2465,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
                sock->statsindex = rawstatsindex;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 
index 8758496e5b0a2db381d6e98e47ced4af049de641..7f6187434108956d52e661935e2a9ce7ae2eca2d 100644 (file)
@@ -596,8 +596,7 @@ isc_url_parse(const char *buf, size_t buflen, bool is_connect,
                        break;
 
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                /* Nothing's changed; soldier on */
index f3e5bb18d78445fcaee34f1c6b4de5be21787273..23686152a4b90a585a16fcc86cf5456a75eea686 100644 (file)
@@ -146,7 +146,7 @@ typedef uintmax_t volatile atomic_uintmax_t;
 
 static inline void
 atomic_store_abort() {
-       INSIST(0);
+       UNREACHABLE();
        ISC_UNREACHABLE();
 }
 
@@ -207,7 +207,7 @@ atomic_store_abort() {
 
 static inline int8_t
 atomic_load_abort() {
-       INSIST(0);
+       UNREACHABLE();
        ISC_UNREACHABLE();
 }
 
@@ -277,7 +277,7 @@ atomic_load_abort() {
 
 static inline int8_t
 atomic_add_abort() {
-       INSIST(0);
+       UNREACHABLE();
        ISC_UNREACHABLE();
 }
 
@@ -344,7 +344,7 @@ atomic_add_abort() {
 
 static inline int8_t
 atomic_and_abort() {
-       INSIST(0);
+       UNREACHABLE();
        ISC_UNREACHABLE();
 }
 
@@ -405,7 +405,7 @@ atomic_and_abort() {
 
 static inline int8_t
 atomic_or_abort() {
-       INSIST(0);
+       UNREACHABLE();
        ISC_UNREACHABLE();
 }
 
@@ -542,7 +542,7 @@ atomic_compare_exchange_strong_explicit64(atomic_int_fast64_t *obj,
 
 static inline bool
 atomic_compare_exchange_abort() {
-       INSIST(0);
+       UNREACHABLE();
        ISC_UNREACHABLE();
 }
 
@@ -582,7 +582,7 @@ atomic_compare_exchange_abort() {
 
 static inline bool
 atomic_exchange_abort() {
-       INSIST(0);
+       UNREACHABLE();
        ISC_UNREACHABLE();
 }
 
index 6903ea2c9cf69cb5dad15774dd428505ba54e2ed..c0687885b2d2690f736663e5fccc77fffbe826ce 100644 (file)
@@ -92,7 +92,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src) {
                dst->zone = ((struct sockaddr_in6 *)src)->sin6_scope_id;
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
                ISC_UNREACHABLE();
        }
 }
index c703710c46e905f2eb9e04529af2ca3442d658b3..62c80c46ed4d7a5cf5e82bab960099669965b669 100644 (file)
@@ -211,8 +211,7 @@ isccc_sexpr_print(isccc_sexpr_t *sexpr, FILE *stream) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 076ef2f2df5095b248ba4c78779a21643134b2a0..f0e596cfabc9c0b001c11ca73211dbfdf717aa11 100644 (file)
@@ -401,8 +401,7 @@ get_subtype(const cfg_obj_t *obj, isc_log_t *lctx, dns_geoip_subtype_t subtype,
                }
                return (subtype);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 3fd452ee599bb3d3d2a11437651ce5f8384b7e6a..3526afd6dbf8b9fc1242a376f8af18b78a5562d6 100644 (file)
@@ -3126,8 +3126,7 @@ parse_querysource(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        } else if ((*flagp & CFG_ADDR_V6OK) != 0) {
                isc_netaddr_any6(&netaddr);
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        for (;;) {
@@ -3212,8 +3211,7 @@ doc_querysource(cfg_printer_t *pctx, const cfg_type_t *type) {
        } else if ((*flagp & CFG_ADDR_V6OK) != 0) {
                cfg_print_cstr(pctx, "<ipv6_address>");
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        cfg_print_cstr(pctx, " | * ) [ port ( <integer> | * ) ] ) | "
                             "( [ [ address ] ( ");
@@ -3222,8 +3220,7 @@ doc_querysource(cfg_printer_t *pctx, const cfg_type_t *type) {
        } else if ((*flagp & CFG_ADDR_V6OK) != 0) {
                cfg_print_cstr(pctx, "<ipv6_address>");
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        cfg_print_cstr(pctx, " | * ) ] port ( <integer> | * ) ) )"
                             " [ dscp <integer> ]");
@@ -3850,8 +3847,7 @@ cfg_print_zonegrammar(const unsigned int zonetype, unsigned int flags,
                /* no zone type is specified for these */
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        for (clause = clauses; clause->name != NULL; clause++) {
index e120e35e6b963dc87b0da0dad7c1c80267c12f52..b2a4a0ee97961e3272a185989dbcbc361db1e61a 100644 (file)
@@ -421,8 +421,7 @@ cfg_tuple_get(const cfg_obj_t *tupleobj, const char *name) {
                        return (tupleobj->value.tuple[i]);
                }
        }
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 }
 
 isc_result_t
@@ -2702,8 +2701,7 @@ cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj) {
                        } else if (result == ISC_R_NOTFOUND) {
                                /* do nothing */
                        } else {
-                               INSIST(0);
-                               ISC_UNREACHABLE();
+                               UNREACHABLE();
                        }
                }
        }
@@ -3038,8 +3036,7 @@ token_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na) {
                        isc_netaddr_any6(na);
                        return (ISC_R_SUCCESS);
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                if ((flags & (CFG_ADDR_V4OK | CFG_ADDR_V4PREFIXOK)) != 0) {
@@ -3322,8 +3319,7 @@ cfg_parse_netprefix(cfg_parser_t *pctx, const cfg_type_t *type,
                addrlen = 128;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        expectprefix = (result == ISC_R_IPV4PREFIX);
        CHECK(cfg_peektoken(pctx, 0));
index 75e05009fdbe9fb503c1030b312dee568b73b4a5..fafbb66bae0c6a431caa03766d73439b035a3a97 100644 (file)
@@ -638,8 +638,7 @@ renderend:
                                            ISC_MIN((int)respsize / 16, 256));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
 #ifdef HAVE_DNSTAP
@@ -668,8 +667,7 @@ renderend:
                                            ISC_MIN((int)respsize / 16, 256));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -1032,8 +1030,7 @@ no_nsid:
                        memmove(addr, &client->ecs.addr.type, addrl);
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                isc_buffer_init(&buf, ecs, sizeof(ecs));
@@ -1145,8 +1142,7 @@ compute_cookie(ns_client_t *client, uint32_t when, uint32_t nonce,
                        inputlen = 32;
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                isc_siphash24(secret, input, inputlen, digest);
@@ -1187,8 +1183,7 @@ compute_cookie(ns_client_t *client, uint32_t when, uint32_t nonce,
                                         digest);
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                for (i = 0; i < 8; i++) {
                        digest[i] ^= digest[i + 8];
@@ -1198,8 +1193,7 @@ compute_cookie(ns_client_t *client, uint32_t when, uint32_t nonce,
        }
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -1807,8 +1801,7 @@ ns__client_request(isc_nmhandle_t *handle, isc_result_t eresult,
                                            ISC_MIN((int)reqsize / 16, 18));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
                switch (isc_sockaddr_pf(&client->peeraddr)) {
@@ -1821,8 +1814,7 @@ ns__client_request(isc_nmhandle_t *handle, isc_result_t eresult,
                                            ISC_MIN((int)reqsize / 16, 18));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
index 72305aa8e651a864de4513d3d0f2724ca3675eed..26d733024bb7222dc5503445edddbba225d05f47 100644 (file)
@@ -2687,8 +2687,7 @@ rpz_get_zbits(ns_client_t *client, dns_rdatatype_t ip_type,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
@@ -2922,8 +2921,7 @@ rpz_get_p_name(ns_client_t *client, dns_name_t *p_name, dns_rpz_zone_t *rpz,
                suffix = &rpz->nsip;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
@@ -3357,8 +3355,7 @@ dnsrps_rewrite_ip(ns_client_t *client, const isc_netaddr_t *netaddr,
                recursed = true;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        do {
@@ -3408,8 +3405,7 @@ dnsrps_rewrite_name(ns_client_t *client, dns_name_t *trig_name, bool recursed,
                trig = LIBRPZ_TRIG_NSDNAME;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        dns_name_toregion(trig_name, &r);
@@ -6986,8 +6982,7 @@ query_checkrpz(query_ctx_t *qctx, isc_result_t result) {
                        qctx->want_restart = true;
                        return (ISC_R_COMPLETE);
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                /*
@@ -8886,8 +8881,7 @@ query_nodata(query_ctx_t *qctx, isc_result_t res) {
                                dns64_ttl(qctx->db, qctx->version);
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                SAVE(qctx->client->query.dns64_aaaa, qctx->rdataset);
@@ -11274,8 +11268,7 @@ query_setup_sortlist(query_ctx_t *qctx) {
        case NS_SORTLISTTYPE_NONE:
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index d9471b67188b0f3de33097826822f96ce8858582..0ee66964c95a08a43ab70095962b7e924a629342 100644 (file)
@@ -955,7 +955,7 @@ fromhex(char c) {
 
        printf("bad input format: %02x\n", c);
        exit(3);
-       /* NOTREACHED */
+       UNREACHABLE();
 }
 
 isc_result_t
index 1870250aeab28aec027da431f5d15c0a5c8daca0..b3e8fc1e2035ff988a382cc3fdd7bf45453ed1a3 100644 (file)
@@ -418,8 +418,7 @@ run_start_test(const ns__query_start_test_params_t *test) {
                         test->id.description, test->id.lineno);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
index 5813585fcf0ee714d45d822e9bc8ff7b455d83ec..1bd95421becf459847f817936c28c8d0c735f8d2 100644 (file)
@@ -758,8 +758,7 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
                mnemonic = "IXFR";
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        ns_client_log(client, DNS_LOGCATEGORY_XFER_OUT, NS_LOGMODULE_XFER_OUT,