]> 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 07:33:43 +0000 (08: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.

91 files changed:
bin/check/named-checkconf.c
bin/check/named-checkzone.c
bin/confgen/tsig-keygen.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/main.c
bin/named/server.c
bin/named/zoneconf.c
bin/rndc/rndc.c
bin/tests/system/rpz/dnsrps.c
bin/tests/test_client.c
bin/tests/test_server.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/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/rbt.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/transport.c
lib/dns/tsec.c
lib/dns/update.c
lib/dns/validator.c
lib/dns/xfrin.c
lib/dns/zone.c
lib/isc/app.c
lib/isc/assertions.c
lib/isc/include/isc/assertions.h
lib/isc/include/isc/util.h
lib/isc/interfaceiter.c
lib/isc/log.c
lib/isc/mem.c
lib/isc/net.c
lib/isc/netaddr.c
lib/isc/netmgr/http.c
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tcp.c
lib/isc/netmgr/tcpdns.c
lib/isc/netmgr/tlsdns.c
lib/isc/netmgr/tlsstream.c
lib/isc/netmgr/udp.c
lib/isc/rwlock.c
lib/isc/siphash.c
lib/isc/sockaddr.c
lib/isc/timer.c
lib/isc/tls.c
lib/isc/url.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 0594ed157e34b5dfe360cf73ed24209f6d3d32e6..06fd59cb8d2f36bc03fbfa51fed9f5bff56ebddf 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;
@@ -437,8 +431,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
                } else if (strcasecmp(masterformatstr, "raw") == 0) {
                        masterformat = dns_masterformat_raw;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
index 80cdfb55d38130546b5fdb2214a85bf089a6b64f..ffee5bcd7769dc063e9254138b07b16354eb5ac9 100644 (file)
@@ -147,8 +147,7 @@ main(int argc, char **argv) {
        } else if (PROGCMP("named-compilezone")) {
                progmode = progmode_compile;
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /* Compilation specific defaults */
index a0d0764112f83a663e523f396ce81bdc5108091d..b34d099faa7a37c9356cac75307d9844a44d97c0 100644 (file)
@@ -121,8 +121,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 be77cb1f53815c3f51ad41a3b5b58d53948e814a..360b9839797ab36224d3f30f2c373775d6f79585 100644 (file)
@@ -1325,7 +1325,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;
@@ -1336,10 +1336,9 @@ dash_option(char *option, char *next, bool *open_type_class) {
                case 'v':
                        printf("delv %s\n", PACKAGE_VERSION);
                        exit(0);
-               /* NOTREACHED */
+                       UNREACHABLE();
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                if (strlen(option) > 1U) {
                        option = &option[1];
@@ -1477,7 +1476,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
                fprintf(stderr, "Invalid option: -%s\n", option);
                usage();
        }
-       /* NOTREACHED */
+       UNREACHABLE();
        return (false);
 }
 
index 4421df9d5db831e5ccf11b6562e7dd00aba617f1..7a7c648d8ec2e164bd01da030ed135285fa8115b 100644 (file)
@@ -2115,7 +2115,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;
@@ -2125,7 +2125,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;
@@ -2377,7 +2377,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
                fprintf(stderr, "Invalid option: -%s\n", option);
                usage();
        }
-       /* NOTREACHED */
+       UNREACHABLE();
        return (false);
 }
 
index fa813901c7d7167d8c3489894121e66b9bb6c7a5..7b68d252ee55d69a77b927fa84abc3229bb49935 100644 (file)
@@ -2468,8 +2468,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 233e12bc1138ae096022586fd7f9a5014ba95d3c..eca8f86b81c3fd7da86d037457106125231f19f7 100644 (file)
@@ -616,7 +616,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 207c861a5d5e1e522557e12259f3281f9534852f..2cceda3fce0fdae9b96b4629efaa0a429220b486 100644 (file)
@@ -461,7 +461,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 38e21c7b7642300d84089b81374adb36a2780ffd..c0d5d99791194c9c4210660f02c3ba198c2712f5 100644 (file)
@@ -217,7 +217,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':
@@ -235,7 +235,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 e11163834d5caa504b7a9a26ede2e39a56ceabea..7c6ad5dc8b8f383725fac584bbc78045cd747d99 100644 (file)
@@ -453,8 +453,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);
 }
@@ -1066,8 +1065,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 af3b4045d91e08d14e579f4aee803c05cc646e91..5fd0904f43fc1649a650228745861b34137385e0 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 e7ed49361274b27e24b824ff5fe87b9e0b17f041..bb4c08bb1ba88bd8ef4be8f45947ab4172489fca 100644 (file)
@@ -728,8 +728,7 @@ parse_port(char *arg) {
                named_g_httpport = port;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 19590f6449654549cd45b3ea27d2f89610fac1ad..831955fef1e90225174feb218582b99c60e679be 100644 (file)
@@ -866,8 +866,7 @@ ta_fromconfig(const cfg_obj_t *key, bool *initialp, const char **namestrp,
                break;
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        return (ISC_R_SUCCESS);
@@ -1273,8 +1272,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));
@@ -1296,8 +1294,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);
@@ -1401,8 +1398,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();
        }
 
        /*
@@ -1558,8 +1554,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();
                }
        }
 
@@ -2933,7 +2928,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(
@@ -4329,8 +4324,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;
@@ -4784,8 +4778,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,
@@ -5184,8 +5177,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();
                }
        }
 
@@ -5198,8 +5190,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;
@@ -5511,8 +5502,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,
@@ -5739,8 +5729,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();
                        }
                }
 
@@ -6281,8 +6270,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();
                        }
                }
        }
@@ -9575,8 +9563,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;
@@ -13654,8 +13641,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();
        }
 
        /*
@@ -16350,8 +16336,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 55f2f358543e44ca8baad468ebe76726b29c5477..9a363b30c318d5b256175ffa467a9768b2a80b0b 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 */
@@ -246,8 +245,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);
@@ -759,8 +757,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);
@@ -1041,8 +1038,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                } else if (strcasecmp(masterformatstr, "raw") == 0) {
                        masterformat = dns_masterformat_raw;
                } else {
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -1065,8 +1061,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();
                }
        }
 
@@ -1159,8 +1154,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) {
@@ -1186,8 +1180,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);
@@ -1266,8 +1259,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,
@@ -1460,8 +1452,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);
@@ -1495,8 +1486,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);
 
@@ -1696,8 +1686,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);
@@ -1756,8 +1745,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);
@@ -1773,8 +1761,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);
@@ -1796,8 +1783,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);
@@ -1813,8 +1799,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,
@@ -1837,8 +1822,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 178120d90d887211cc51b37d32d3347362c6e761..4c43e39ba00a14316e9cf22eadd763cc3aecb25e 100644 (file)
@@ -592,8 +592,7 @@ rndc_startconnect(isc_sockaddr_t *addr) {
                 */
                fatal("UNIX domain sockets not currently supported");
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        atomic_fetch_add_relaxed(&connects, 1);
index dfbe76147f819323a523873ee29f9c41bf2c45f2..4f8890873df367e2aec1ca5a49459846386dc20a 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 5ba259087ecce30be64acd2a517363dc64a070d1..bd5e543b6d56ea1def4147e177d54b25c2a84842 100644 (file)
@@ -432,8 +432,7 @@ run(void) {
        } break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        waitforsignal();
index affa92614e5b0ffa9226be82e77fe85cc5b318b5..a5b88339637dd17021155162cb9a12fd27251105 100644 (file)
@@ -302,8 +302,7 @@ run(void) {
        } break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        REQUIRE(result == ISC_R_SUCCESS);
 
index 3944e3b00b906bda3b905b64cbd78a53908ffa22..9f50981f046ffaae4aa3a4f7eed0985fe56d32b7 100644 (file)
@@ -58,7 +58,7 @@ fromhex(char c) {
 
        fprintf(stderr, "bad input format: %02x\n", c);
        exit(3);
-       /* NOTREACHED */
+       UNREACHABLE();
 }
 
 static void
index a8dd85da38c093f573740246bb259ceb0a6660b1..af395826b930c2425ddd7d3be12515fd556dc6ea 100644 (file)
@@ -1698,7 +1698,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;
@@ -1709,7 +1709,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;
@@ -1817,7 +1817,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 3a71b859958625e55b3176190f05c52301e71424..7551211c024045f67c6e7688e4327deb3fa2d41c 100644 (file)
@@ -142,12 +142,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 556bfb6faf8c81309b956f0aa23b0d6c2a70001a..5ced085ac4c4bd761248925bb7b281406a059df5 100644 (file)
@@ -2654,8 +2654,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;
@@ -3054,8 +3053,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                        break;
 
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
index 1dfbf33675c5f51f56dbc6d93e56e8c09b35a475..f38ce3b64bdf21ff9791c970bcf95b63a7ad461f 100644 (file)
@@ -464,8 +464,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,
@@ -658,8 +657,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
                        return (true);
 
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
index 9c2a2516f73d75c35539bfc20dbbc43eb3e32e16..f5f7cef11c9b0d2c2f2a1a76e3224ed4ddbd7230 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 0fcac79d3c997d198708d5acb133723853a3b52a..c7e683b93163df7e4e76e49a18dd430b23282264 100644 (file)
@@ -1543,8 +1543,7 @@ dispatch_getnext(dns_dispatch_t *disp, dns_dispentry_t *resp, int32_t timeout) {
                break;
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -1710,8 +1709,7 @@ startrecv(isc_nmhandle_t *handle, dns_dispatch_t *disp, dns_dispentry_t *resp) {
                break;
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -1838,8 +1836,7 @@ dns_dispatch_connect(dns_dispentry_t *resp) {
                        break;
 
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                break;
index 9ff55b27a43185eb50bc2aac029e2c206dbe0f32..30b7052b3ed0a05fdbc4d6bf27a14952fba7668e 100644 (file)
@@ -311,8 +311,7 @@ dns_dnsrps_2policy(librpz_policy_t rps_policy) {
        case LIBRPZ_POLICY_GIVEN:
        case LIBRPZ_POLICY_DISABLED:
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 44e5f6e160e2280394822ee6fad6a7d1b7d2e20c..e013ec27fabaad336997ae6892af16f25e04c77f 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 7b39d853001322d7aec1692635587d79b828c75d..22f158bd71e46fe9216d494f3ec5a6bd36541add 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 244e1f15774c34020845ef0440a83d3be2cff7a9..5764a0ff07289b98f49a6953665d170f1591c0a3 100644 (file)
@@ -370,8 +370,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();
        }
 }
 
@@ -390,8 +389,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();
        }
 }
 
@@ -443,8 +441,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 89ac28c4f92c869860d5119aa89cfde9e8ed5606..d9aee371c6c62c4bd0bff94c7f5801cd7c655fe6 100644 (file)
@@ -825,8 +825,7 @@ ixfr_order(const void *av, const void *bv) {
                aop = 0;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        switch (b->op) {
@@ -839,8 +838,7 @@ ixfr_order(const void *av, const void *bv) {
                bop = 0;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        r = bop - aop;
index 6bc11dbb62c0bfff0730860469efc2b3f32aef7c..660b8cd26f11e4efdba59dbf7ef8eab6dfcf8108 100644 (file)
@@ -1366,8 +1366,7 @@ keymgr_transition_time(dns_dnsseckey_t *key, int type,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
                break;
        }
 
index 020e4a1b8d3d85e300de8f0f6a1711179dd9d262..a9cfe4d4fa5026e7befe0df55469a1db863be45c 100644 (file)
@@ -540,8 +540,7 @@ loadctx_create(dns_masterformat_t format, isc_mem_t *mctx, unsigned int options,
                lctx->load = load_raw;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (lex != NULL) {
index ae2e815c866c2edda6c9ca416648647be5dad109..e2743de806557139fbf80e7020b5ee6dda52d8eb 100644 (file)
@@ -1580,8 +1580,7 @@ dumpctx_create(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
                dctx->dumpsets = dump_rdatasets_raw;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        result = totext_ctx_init(style, NULL, &dctx->tctx);
@@ -1701,8 +1700,7 @@ writeheader(dns_dumpctx_t *dctx) {
 
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        isc_mem_put(dctx->mctx, buffer.base, buffer.length);
index 04a3345226242474f8ecff5bdbb2c68589c326d9..31d92a96ca7345a796362db3334b3580e144922d 100644 (file)
@@ -883,8 +883,7 @@ getname(dns_name_t *name, isc_buffer_t *source, dns_message_t *msg,
                }
        }
 
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 }
 
 static isc_result_t
index 2a8f9a5d771c5638fd6b3d196a96ccd2a38006da..d9d55eb4f15ca817f2f4f9bc24315673761526d9 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 f1cb63eb0effdbf4008b4c7f82bc0a2adf4f193b..519e88b7e7a6c904a3cbaf1abd8896a52c7ace99 100644 (file)
@@ -1153,8 +1153,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);
index 2e39bf69e21213603dc7cacbf0d06c9db4f46887..be1998e3819183081bef0bf420125e2e0d205b28 100644 (file)
@@ -83,8 +83,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();
@@ -104,8 +103,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)) {
@@ -426,8 +424,7 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (exp == 0) {
index 2ada8416558c51d84eae87b5b488f46ca803c439..bac2624e09ff51682f2f715ab5172c26934e8e87 100644 (file)
@@ -251,8 +251,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 9ebe4e50f26b9966528351789478da9b415ace04..fd6fb1f42776261d3ae3e3fa73597c23bb8d8257 100644 (file)
@@ -1805,8 +1805,7 @@ nexttable:
        }
 
        /* We haven't found any matching node, this should not be possible. */
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 }
 
 static inline void
index 8757fbd5ab0fb71323fb37f0ad7f8d942092c455..79c65ae9cea77e48f9838502101e940041e9e121 100644 (file)
@@ -4440,7 +4440,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);
 }
 
@@ -7606,8 +7606,7 @@ nodecount(dns_db_t *db, dns_dbtree_t tree) {
                count = dns_rbt_nodecount(rbtdb->nsec3);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
 
index 020cfcf06d81bc6ce91c06dcfa3ad6f85832aa72..54e08ba662962de91a7dc172d751eac49ee2fff4 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 4c203a4de328cdd0e62c3c9078eeffb094651432..d6632e61494f8fb596c5e616bf8e7eacfd733e83 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 b2b8657b9700a59793a7fbce58d0b7ee38701383..848505269bedaacb7f0a72b08c773c37d0646453 100644 (file)
@@ -322,8 +322,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) -
@@ -732,8 +731,7 @@ generic_totext_in_svcb(ARGS_TOTEXT) {
                        }
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
        return (ISC_R_SUCCESS);
index 5865b8a4d647b75b4fca02d4514f11330cbb7b43..4d910a640e93bb5db7a55930d4ac6bf7531d7d05 100644 (file)
@@ -2323,8 +2323,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);
 }
@@ -7088,8 +7087,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 0f316308ddaa46f634d8b398cf8b8535db5a8de5..d03330dca0c490656bf261c813dc581ebac58773 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) {
@@ -2658,8 +2654,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 142b47fd1d12a0178974e137b3239e8e3a0197cf..9d3c8f6fa34f2a774c6eced44aae1b4f834b8bad 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 54e9b48018bd27a3ab6a73806734ef33d6410376..2608c294c22918d03f1ca543007432bcea9cfde6 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 ba50846794dd8227395f7315301a99e220016735..9b2af6d0ed9017a42a039885c4457e12fdd36bff 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 a254c610f4a7122cc00458d7aa3f824a5eca0242..92db924469f3b13a3f8b08dfa28734230afdea41 100644 (file)
@@ -227,8 +227,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));
@@ -269,8 +268,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 47ff71644d9134cf5b9188da33a88d2ebe7b2996..e3da9d4785641ea51a7106892c8e3b834003aa63 100644 (file)
@@ -372,7 +372,7 @@ fromhex(char c) {
 
        printf("bad input format: %02x\n", c);
        exit(3);
-       /* NOTREACHED */
+       UNREACHABLE();
 }
 
 /*
index 2523c7b8f0c36d6c0c5889d8c8a4440ead78849c..abe64f9e4e550ba4f6e6fb5b0ee3467ba7ddf6f4 100644 (file)
@@ -120,8 +120,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 7937f2d21040962366ab27c8ca09143f3bd2dc57..e7fbb70ac3cd387d9862195f1833cb135ca97601 100644 (file)
@@ -327,8 +327,7 @@ dns_transport_get_prefer_server_ciphers(const dns_transport_t *transport,
                return (true);
        }
 
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
        return false;
 }
 
index 6127cf34e9bc5b42b8a8d05e975f121ee7747b15..fcb761348bc55d64ac11ec6de6e55e0767baf8b5 100644 (file)
@@ -91,8 +91,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;
@@ -118,8 +117,7 @@ dns_tsec_destroy(dns_tsec_t **tsecp) {
                dst_key_free(&tsec->ukey.key);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        tsec->magic = 0;
@@ -146,7 +144,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 610643b80716b13055e062603ba227fe8f877fc4..9241b1cad657e9e7c83eb223c518c6d245750261 100644 (file)
@@ -1970,8 +1970,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);
@@ -2145,8 +2144,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);
@@ -2173,8 +2171,7 @@ next_state:
                INSIST(ISC_LIST_EMPTY(state->nsec_mindiff.tuples));
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
 failure:
@@ -2234,8 +2231,7 @@ dns__update_soaserial(uint32_t serial, dns_updatemethod_t method) {
                }
                return (serial);
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2266,8 +2262,7 @@ dns_update_soaserial(uint32_t serial, dns_updatemethod_t method,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (used != NULL) {
index 5014e500fb1fc38b5b7734f6b0d6178976be0741..64f876f807ec3378512feb550dfcfe94846b1163 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 2136cb7fc5e4558a4791285475140083e9c1c780..5df10d3dedec38dfbcc54216a7813d7d0424c0fe 100644 (file)
@@ -682,8 +682,7 @@ redo:
                FAIL(DNS_R_EXTRADATA);
                FALLTHROUGH;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        result = ISC_R_SUCCESS;
 failure:
@@ -1029,8 +1028,7 @@ xfrin_start(dns_xfrin_ctx_t *xfr) {
                                     connect_xfr, 30000, 0, tlsctx);
        } break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        return (ISC_R_SUCCESS);
index 58f173347007af8def27772ed8cd4a665100968d..646bfd1f5da9bac8828e8155e7301a0f06ff0b9a 100644 (file)
@@ -10135,8 +10135,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);
 }
@@ -18176,8 +18175,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(&primaryaddr) == isc_sockaddr_pf(&sourceaddr));
@@ -19952,8 +19950,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);
 }
@@ -20035,8 +20032,7 @@ dns_zonemgr_getcount(dns_zonemgr_t *zmgr, int state) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        RWUNLOCK(&zmgr->rwlock, isc_rwlocktype_read);
index d5bf097e99bb3c1ddba76a9adc272930990921c8..d02371c95004c50ca23f92fd4e680a8429e50649 100644 (file)
@@ -245,8 +245,7 @@ isc_app_ctxrun(isc_appctx_t *ctx) {
                                                             true);
                                        break;
                                default:
-                                       INSIST(0);
-                                       ISC_UNREACHABLE();
+                                       UNREACHABLE();
                                }
                        }
                } else {
index 5470d81715a21271c0df49d2c9ace5bebcafbc12..8b954cf475e0ba5588d37ee426d1e8217b17830a 100644 (file)
@@ -48,7 +48,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 7045179cbafbc868bb9c7f24582cf437e38f1b1c..d5dbced8534df4684cc31ceb597f0e19337e40db 100644 (file)
@@ -66,4 +66,9 @@ 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
index d0cd0197d38f8943e109faf7f73e1f369f5b3c5c..63d3af340c4ea3cc6a62c717d903b6636a7509ca 100644 (file)
  * Performance
  */
 
-#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
@@ -278,6 +272,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) \
@@ -300,6 +296,8 @@ mock_assert(const int result, const char *const expression,
 /*% Invariant Assertion */
 #define INVARIANT(e) ISC_INVARIANT(e)
 
+#define UNREACHABLE() ISC_UNREACHABLE()
+
 #endif /* UNIT_TESTING */
 
 /*
index 54b13eba65bacd5a52b39a6e38d8acc7447f4188..abb16f4b6da0683dc1300ae059fed76e12ebe080 100644 (file)
@@ -125,8 +125,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index f41c39237dd9dc016beb59815185479686e339fb..95c3e6b05d671a095bc77d12f1dcc1e489d98631 100644 (file)
@@ -707,8 +707,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 f21954b65af189485213599185346e4ad9719902..ea6d4cc95e5f744e218e98f9762154392050d17f 100644 (file)
@@ -319,8 +319,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();
 unlock:
        MCTXUNLOCK(mctx);
 }
@@ -1436,8 +1435,7 @@ isc__mem_checkdestroyed(void) {
                        print_contexts(file);
                }
 #endif /* if ISC_MEM_TRACKLINES */
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        UNLOCK(&contextslock);
 }
index 9a720837607e9d46f140fa6b9d2a94f4f6ff3983..5525762d93aa0769eda367f4c33807cf9b7ba718 100644 (file)
@@ -506,8 +506,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 9ccf12e74b6a01117d0f869b914ef740f123a474..940fbf0370c59581e0ab5e92f2bc6686577306ec 100644 (file)
@@ -352,8 +352,7 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) {
                t->zone = 0;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 0d06c1b9020d063786d55417d4a791b4c0c7f60e..d09ad5b8c7a76864590ee7f7e87bd76bc91855f3 100644 (file)
@@ -2107,8 +2107,7 @@ server_on_request_recv(nghttp2_session *ngsession,
                INSIST(socket->h2.content_length > 0);
                isc_buffer_usedregion(&socket->h2.rbuf, &data);
        } else {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        server_call_cb(socket, session, ISC_R_SUCCESS, &data);
@@ -2671,8 +2670,7 @@ isc__nm_http_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()) {
index 4216b5c24b1206ea0630069b8d7f97a02e86cf5f..122e5e84a202e006c09403ca21b1adf439b07f64 100644 (file)
@@ -521,8 +521,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
 
@@ -720,8 +719,7 @@ process_all_queues(isc__networker_t *worker) {
                        reschedule = true;
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -793,8 +791,7 @@ isc__nm_async_task(isc__networker_t *worker, isc__netievent_t *ev0) {
        case ISC_R_SUCCESS:
                return;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -922,8 +919,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);
 }
@@ -1074,8 +1070,7 @@ isc__nm_enqueue_ievent(isc__networker_t *worker, isc__netievent_t *event) {
        } else {
                switch (event->type) {
                case netievent_prio:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                        break;
                case netievent_privilegedtask:
                        type = NETIEVENT_PRIVILEGED;
@@ -1462,8 +1457,7 @@ isc___nmsocket_init(isc_nmsocket_t *sock, isc_nm_t *mgr, isc_nmsocket_type type,
                         */
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                break;
        case isc_nm_tcpsocket:
@@ -1482,8 +1476,7 @@ isc___nmsocket_init(isc_nmsocket_t *sock, isc_nm_t *mgr, isc_nmsocket_type type,
                        sock->statsindex = tcp6statsindex;
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
                break;
        default:
@@ -1921,8 +1914,7 @@ isc__nm_failed_read_cb(isc_nmsocket_t *sock, isc_result_t result, bool async) {
                isc__nm_tlsdns_failed_read_cb(sock, result, async);
                return;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2142,8 +2134,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);
@@ -2182,8 +2173,7 @@ isc__nm_start_reading(isc_nmsocket_t *sock) {
                UV_RUNTIME_CHECK(uv_read_start, r);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        atomic_store(&sock->reading, true);
 }
@@ -2208,8 +2198,7 @@ isc__nm_stop_reading(isc_nmsocket_t *sock) {
                UV_RUNTIME_CHECK(uv_read_stop, r);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        atomic_store(&sock->reading, false);
 }
@@ -2234,8 +2223,7 @@ processbuffer(isc_nmsocket_t *sock) {
        case isc_nm_tlsdnssocket:
                return (isc__nm_tlsdns_processbuffer(sock));
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2514,8 +2502,7 @@ isc_nm_send(isc_nmhandle_t *handle, isc_region_t *region, isc_nm_cb_t cb,
                break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2545,8 +2532,7 @@ isc_nm_read(isc_nmhandle_t *handle, isc_nm_recv_cb_t cb, void *cbarg) {
                break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2573,8 +2559,7 @@ isc_nm_cancelread(isc_nmhandle_t *handle) {
                break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2594,8 +2579,7 @@ isc_nm_pauseread(isc_nmhandle_t *handle) {
                break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2615,8 +2599,7 @@ isc_nm_resumeread(isc_nmhandle_t *handle) {
                break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2646,8 +2629,7 @@ isc_nm_stoplistening(isc_nmsocket_t *sock) {
                break;
 #endif
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -2828,7 +2810,7 @@ isc__nmsocket_reset(isc_nmsocket_t *sock) {
                break;
        default:
                INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
                break;
        }
 
@@ -2870,8 +2852,7 @@ isc__nmsocket_shutdown(isc_nmsocket_t *sock) {
        case isc_nm_tlsdnslistener:
                return;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -3348,8 +3329,7 @@ isc__nm_set_network_buffers(isc_nm_t *nm, uv_handle_t *handle) {
                        atomic_load_relaxed(&nm->send_udp_buffer_size);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        if (recv_buffer_size > 0) {
@@ -3457,8 +3437,7 @@ isc_nm_bad_request(isc_nmhandle_t *handle) {
        case isc_nm_tlssocket:
 #endif /* HAVE_LIBNGHTTP2 */
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
                break;
        }
 }
@@ -3481,8 +3460,7 @@ isc_nm_xfr_allowed(isc_nmhandle_t *handle) {
                return (false);
        }
 
-       INSIST(0);
-       ISC_UNREACHABLE();
+       UNREACHABLE();
 
        return (false);
 }
@@ -3526,7 +3504,7 @@ isc_nm_set_maxage(isc_nmhandle_t *handle, const uint32_t ttl) {
 #endif /* HAVE_LIBNGHTTP2 */
        default:
                INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
                break;
        }
 }
@@ -3602,8 +3580,7 @@ nmsocket_type_totext(isc_nmsocket_type type) {
        case isc_nm_httpsocket:
                return ("isc_nm_httpsocket");
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 85edea5df6b5d6ed3d66d768f2d83e3ec3497cdf..9fc80c4d20fc8f0f57d4c51c82238158e08b171c 100644 (file)
@@ -647,8 +647,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()) {
@@ -1158,8 +1157,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, STATID_CLOSE);
@@ -1177,8 +1175,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, STATID_CLOSE);
index a0d7961ff80f139570f83e363474cffc4d72b39b..53c2f30ff2b945f127b3a49820a244cf7f8faab7 100644 (file)
@@ -613,8 +613,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()) {
@@ -1210,8 +1209,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, STATID_CLOSE);
@@ -1229,8 +1227,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, STATID_CLOSE);
index 1347666232da61c6c8288be29790ff88a49b078f..4864fcc477b5aa9d407b864293089717190d7e46 100644 (file)
@@ -685,8 +685,7 @@ isc__nm_tlsdns_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()) {
@@ -760,8 +759,7 @@ isc__nm_async_tlsdnsshutdown(isc__networker_t *worker, isc__netievent_t *ev0) {
                tls_shutdown(sock);
                return;
        case 0:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        case SSL_ERROR_ZERO_RETURN:
                tls_error(sock, ISC_R_EOF);
                break;
@@ -1737,8 +1735,7 @@ tlsdns_send_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
        case SSL_ERROR_WANT_READ:
                break;
        case 0:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        default:
                return (ISC_R_TLSERROR);
        }
@@ -1764,8 +1761,7 @@ tlsdns_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, STATID_CLOSE);
@@ -1788,8 +1784,7 @@ tlsdns_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, STATID_CLOSE);
index 6df651f2048e36b663391bc4feee84ea3c7aeae5..252b52da9f5e6fb4d109131292e88b672a51e137 100644 (file)
@@ -856,8 +856,7 @@ isc__nm_tls_stoplistening(isc_nmsocket_t *sock) {
 
        if (!atomic_compare_exchange_strong(&sock->closing, &(bool){ false },
                                            true)) {
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        atomic_store(&sock->listening, false);
index 1067f0153313997650a49ee08f5f4e63375f7a87..3a43cd3b84d79e7321e383ba1ab80041922835ff 100644 (file)
@@ -516,8 +516,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()) {
@@ -1175,8 +1174,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, STATID_CLOSE);
@@ -1197,8 +1195,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, STATID_CLOSE);
index 4c11feb518140337261381afadf830dcefac31ef..c76ea74dda342418b677dad816d0e7eff0774528 100644 (file)
@@ -62,8 +62,7 @@ isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
        return (ISC_R_SUCCESS);
 }
@@ -94,8 +93,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 e2f363ef1bcad0065a2e7753ba4ec37fdf194c11..85b3d284394ce7a9f18a7e3651e9afd7d3a58df5 100644 (file)
@@ -295,8 +295,7 @@ isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int pf) {
                isc_sockaddr_any6(sockaddr);
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -366,8 +365,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 720f972260b2b56325d1099103f88299f8698199..f833000601f6c4059feb22cbe3e6eed7167093c4 100644 (file)
@@ -118,7 +118,7 @@ schedule(isc_timer_t *timer, isc_time_t *now, bool signal_ok) {
                break;
        default:
                INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
@@ -426,7 +426,7 @@ dispatch(isc_timermgr_t *manager, isc_time_t *now) {
                        break;
                default:
                        INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                timer->index = 0;
index a726d94aeb32640f752f50b5e6f71860056d65ba..b71cdd6aadef8bb0159432edefee6c74f37028c8 100644 (file)
@@ -511,8 +511,7 @@ get_tls_version_disable_bit(const isc_tls_protocol_version_t tls_ver) {
 #endif
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
                break;
        };
 
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 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 d03dc40fe323508c92a9c108c618191a9dfd7f77..716ffe6cee0056daae4a0f4bda1814ae20cff992 100644 (file)
@@ -399,8 +399,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 36e20cd1b28408cc2d0bc339162fe44f66d24dd6..203e066926c6ec57c626777ae0edab75659afd06 100644 (file)
@@ -3172,8 +3172,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 (;;) {
@@ -3258,8 +3257,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 ] ( ");
@@ -3268,8 +3266,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> ]");
@@ -3893,8 +3890,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 1b4e164725a89efe1a150d2b5bf4bf9c36d6d5aa..eeea6e779043a26a414dec5468beca58c97b348b 100644 (file)
@@ -423,8 +423,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
@@ -2679,8 +2678,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();
                        }
                }
        }
@@ -3015,8 +3013,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) {
@@ -3294,8 +3291,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 b0fa0c40e99ac81bf041db7a6f6a1427566fef50..27fdffb15fb7d7f4b7b68e6294f213ca54edde29 100644 (file)
@@ -678,8 +678,7 @@ renderend:
                                            ISC_MIN((int)respsize / 16, 256));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        } else {
 #ifdef HAVE_DNSTAP
@@ -708,8 +707,7 @@ renderend:
                                            ISC_MIN((int)respsize / 16, 256));
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
        }
 
@@ -1072,8 +1070,7 @@ no_nsid:
                        memmove(addr, &client->ecs.addr.type, addrl);
                        break;
                default:
-                       INSIST(0);
-                       ISC_UNREACHABLE();
+                       UNREACHABLE();
                }
 
                isc_buffer_init(&buf, ecs, sizeof(ecs));
@@ -1193,8 +1190,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);
@@ -1235,8 +1231,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];
@@ -1246,8 +1241,7 @@ compute_cookie(ns_client_t *client, uint32_t when, uint32_t nonce,
        }
 
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
@@ -1871,8 +1865,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)) {
@@ -1885,8 +1878,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 9a661c6d0a22286cc6f33592ede9575231acb52e..253baa42d5db57fbbb89bab4a2efae96f8f7fa21 100644 (file)
@@ -2731,8 +2731,7 @@ rpz_get_zbits(ns_client_t *client, dns_rdatatype_t ip_type,
                }
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        /*
@@ -2969,8 +2968,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();
        }
 
        /*
@@ -3404,8 +3402,7 @@ dnsrps_rewrite_ip(ns_client_t *client, const isc_netaddr_t *netaddr,
                recursed = true;
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 
        do {
@@ -3455,8 +3452,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);
@@ -7306,8 +7302,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();
                }
 
                /*
@@ -9202,8 +9197,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);
@@ -11602,8 +11596,7 @@ query_setup_sortlist(query_ctx_t *qctx) {
        case NS_SORTLISTTYPE_NONE:
                break;
        default:
-               INSIST(0);
-               ISC_UNREACHABLE();
+               UNREACHABLE();
        }
 }
 
index 690af2c64be4119fa484319b1bbc77ab61237b38..8158a15aee7f1604f89b0a65f76f5718caa46219 100644 (file)
@@ -919,7 +919,7 @@ fromhex(char c) {
 
        printf("bad input format: %02x\n", c);
        exit(3);
-       /* NOTREACHED */
+       UNREACHABLE();
 }
 
 isc_result_t
index e1b05c61c10cdc45901bdfb642485a24e3073320..9c8005fa5f960bbab503e5e68c886a4843a461f5 100644 (file)
@@ -433,8 +433,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 c763db873ed0665665b27876a211d5aa603e5a44..04388d522ccc8787face98ef3b6132a9975a6a42 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,