fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
usage();
fprintf(stderr, "%s: invalid argument -%c\n",
prog_name, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
usage();
break;
case 'A':
list_almost_all = true;
- /* FALL THROUGH */
+ FALLTHROUGH;
case 'a':
if (!lookup->rdtypeset ||
lookup->rdtype != dns_rdatatype_axfr) {
}
break;
case 'F':
- /* Reserved for FIPS mode */
- /* FALLTHROUGH */
+ /* Reserved for FIPS mode */
+ FALLTHROUGH;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
usage();
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
usage();
prepub = strtottl(isc_commandline_argument);
break;
case 'F':
- /* Reserved for FIPS mode */
- /* FALLTHROUGH */
+ /* Reserved for FIPS mode */
+ FALLTHROUGH;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
usage();
ctx.prepub = strtottl(isc_commandline_argument);
break;
case 'F':
- /* Reserved for FIPS mode */
- /* FALLTHROUGH */
+ /* Reserved for FIPS mode */
+ FALLTHROUGH;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
usage();
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
usage();
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
usage();
break;
case 'F':
- /* Reserved for FIPS mode */
- /* FALLTHROUGH */
+ /* Reserved for FIPS mode */
+ FALLTHROUGH;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
usage();
"use -o to specify a different zone origin",
origin, file);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
fatal("failed loading zone from '%s': %s", file,
isc_result_totext(result));
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
/* Does not return. */
}
break;
case 'F':
- /* Reserved for FIPS mode */
- /* FALLTHROUGH */
+ /* Reserved for FIPS mode */
+ FALLTHROUGH;
case '?':
usage();
if (isc_commandline_option == '?') {
"an argument",
isc_commandline_option);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
named_main_earlyfatal("parsing options returned %d",
ch);
dns_zone_setxfracl(zone, none);
dns_acl_detach(&none);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case dns_zone_secondary:
case dns_zone_stub:
case dns_zone_redirect:
program, isc_commandline_option);
usage(1);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'h':
usage(0);
break;
if (dns_rdataset_isassociated(&rdataset)) {
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
if (dbi == NULL) {
dns_db_detach(&db);
--pattern;
}
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
norm:
if (c == *string) {
The following lint and lint-like comments should be used where appropriate:
/* ARGSUSED */
- /* FALLTHROUGH */
+ FALLTHROUGH;
/* NOTREACHED */
/* VARARGS */
goto again;
}
#endif /* ifdef AI_ADDRCONFIG */
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
return (ISC_R_FAILURE);
}
inc_stat(dns_dnssecstats_fail);
return (DNS_R_SIGINVALID);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
if (!dns_name_issubdomain(name, &sig.signer)) {
inc_stat(dns_dnssecstats_fail);
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DNS_DTTYPE_AQ:
case DNS_DTTYPE_CQ:
case DNS_DTTYPE_FQ:
isc_buffer_putstr(target, KEYDATA);
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
if ((ctx->style.flags & DNS_STYLEFLAG_UNKNOWNFORMAT) !=
0) {
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ft_start:
label = ndata;
ndata++;
if (nrem == 0) {
return (ISC_R_NOSPACE);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ft_ordinary:
if (c == '.') {
if (count == 0) {
}
state = ft_escape;
POST(state);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ft_escape:
if (!isdigit((unsigned char)c)) {
if (count >= 63) {
digits = 0;
value = 0;
state = ft_escdecimal;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ft_escdecimal:
if (!isdigit((unsigned char)c)) {
return (DNS_R_BADESCAPE);
0) {
goto no_escape;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 0x22: /* '"' */
case 0x28: /* '(' */
case 0x29: /* ')' */
isc_region_consume(&sregion, length);
break;
case DNS_OPT_CLIENT_TAG:
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DNS_OPT_SERVER_TAG:
if (length != 2) {
return (DNS_R_OPTERR);
if (query->rmessage->counts[DNS_SECTION_QUESTION] == 0) {
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case dns_rcode_nxrrset: /* Not expected. */
case dns_rcode_badcookie:
case dns_rcode_noerror:
if (dns_name_compare(name, dns_rootname) == 0) {
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
result = ISC_R_FAILURE;
goto cleanup;
found_zbits = nm_data->set.ns;
}
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DNS_R_PARTIALMATCH:
i = chain.level_matches;
update_log(log, zone, ISC_LOG_DEBUG(3),
"updated data signatures");
- /* FALLTHROUGH */
+ FALLTHROUGH;
case remove_orphaned:
state->state = remove_orphaned;
update_log(log, zone, ISC_LOG_DEBUG(3),
"rebuilding NSEC chain");
- /* FALLTHROUGH */
+ FALLTHROUGH;
case build_chain:
state->state = build_chain;
/*
CHECK(uniqify_name_list(&state->affected));
- /* FALLTHROUGH */
+ FALLTHROUGH;
case process_nsec:
state->state = process_nsec;
update_log(log, zone, ISC_LOG_DEBUG(3),
"signing rebuilt NSEC chain");
- /* FALLTHROUGH */
+ FALLTHROUGH;
case sign_nsec:
state->state = sign_nsec;
/* Update RRSIG NSECs. */
}
ISC_LIST_APPENDLIST(state->nsec_mindiff.tuples,
state->work.tuples, link);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case update_nsec3:
state->state = update_nsec3;
}
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case process_nsec3:
state->state = process_nsec3;
while ((t = ISC_LIST_HEAD(state->affected.tuples)) != NULL) {
update_log(log, zone, ISC_LOG_DEBUG(3),
"signing rebuilt NSEC3 chain");
- /* FALLTHROUGH */
+ FALLTHROUGH;
case sign_nsec3:
state->state = sign_nsec3;
/* Update RRSIG NSEC3s. */
goto unexpected;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ISC_R_SUCCESS:
if (trustchain) {
/*
case XFRST_AXFR_END:
case XFRST_IXFR_END:
FAIL(DNS_R_EXTRADATA);
- /* NOTREACHED */
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
INSIST(0);
ISC_UNREACHABLE();
break;
case XFRST_AXFR_END:
CHECK(axfr_finalize(xfr));
- /* FALLTHROUGH */
+ FALLTHROUGH;
case XFRST_IXFR_END:
/*
* Close the journal.
if (zone->masters == NULL) {
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case dns_zone_secondary:
case dns_zone_mirror:
case dns_zone_stub:
if (zone->masters == NULL) {
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case dns_zone_secondary:
case dns_zone_mirror:
case dns_zone_stub:
switch (result) {
case ISC_R_SUCCESS:
*needdump = true;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DNS_R_UPTODATE:
if (dns_journal_recovered(journal)) {
*fixjournal = true;
if (zone->masters != NULL) {
goto treat_as_slave;
}
- /* FALLTHROUGH */
-
+ FALLTHROUGH;
case dns_zone_primary:
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDNOTIFY) ||
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDSTARTUPNOTIFY))
{
next = zone->notifytime;
}
- /* FALLTHROUGH */
-
+ FALLTHROUGH;
case dns_zone_stub:
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_REFRESH) &&
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOMASTERS) &&
switch (xfrresult) {
case ISC_R_SUCCESS:
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDNOTIFY);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DNS_R_UPTODATE:
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_FORCEXFER);
/*
zone->curmaster++;
} while (zone->curmaster < zone->masterscnt &&
zone->mastersok[zone->curmaster]);
- /* FALLTHROUGH */
same_master:
if (zone->curmaster >= zone->masterscnt) {
zone->curmaster = 0;
* ISC_ or isc_ to the name.
*/
+/***
+ *** Clang Compatibility Macros
+ ***/
+
+#if !defined(__has_attribute)
+#define __has_attribute(x) 0
+#endif /* if !defined(__has_attribute) */
+
+#if !defined(__has_feature)
+#define __has_feature(x) 0
+#endif /* if !defined(__has_feature) */
+
/***
*** General Macros.
***/
#define ISC_NONSTRING
#endif /* __GNUC__ */
+#if __GNUC__ >= 7 || __has_attribute(fallthrough)
+#define FALLTHROUGH __attribute__((fallthrough))
+#else
+/* clang-format off */
+#define FALLTHROUGH do {} while (0) /* FALLTHROUGH */
+/* clang-format on */
+#endif
+
#if HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR && HAVE_FUNC_ATTRIBUTE_DESTRUCTOR
#define ISC_CONSTRUCTOR __attribute__((constructor))
#define ISC_DESTRUCTOR __attribute__((destructor))
#define ISC_UNREACHABLE()
#endif /* ifdef HAVE_BUILTIN_UNREACHABLE */
-#if !defined(__has_feature)
-#define __has_feature(x) 0
-#endif /* if !defined(__has_feature) */
-
/* GCC defines __SANITIZE_ADDRESS__, so reuse the macro for clang */
#if __has_feature(address_sanitizer)
#define __SANITIZE_ADDRESS__ 1
state = lexstate_vpairstart;
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case lexstate_vpairstart:
if (state == lexstate_vpairstart) {
if (c == '"' &&
}
state = lexstate_vpair;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case lexstate_vpair:
/*
* EOF needs to be checked before lex->specials[c]
}
channel->flags &= ~ISC_LOG_OPENERR;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ISC_LOG_TOFILEDESC:
fprintf(FILE_STREAM(channel), "%s%s%s%s%s%s%s%s%s%s\n",
if (!atomic_load(&sock->client)) {
break;
}
- /* fallthrough */
+ FALLTHROUGH;
case isc_nm_tcpsocket:
INSIST(sock->statichandle == NULL);
isc__nmsocket_reset(sock);
return;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
isc__nmsocket_shutdown(sock);
}
result = isc_timer_reset(rl->timer, isc_timertype_inactive,
NULL, NULL, false);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case isc_ratelimiter_idle:
case isc_ratelimiter_stalled:
rl->state = isc_ratelimiter_stalled;
switch (left) {
case 7:
b |= ((uint64_t)in[6]) << 48;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 6:
b |= ((uint64_t)in[5]) << 40;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 5:
b |= ((uint64_t)in[4]) << 32;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 4:
b |= ((uint64_t)in[3]) << 24;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 3:
b |= ((uint64_t)in[2]) << 16;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 2:
b |= ((uint64_t)in[1]) << 8;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 1:
b |= ((uint64_t)in[0]);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 0:
break;
default:
switch (left) {
case 3:
b |= ((uint32_t)in[2]) << 16;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 2:
b |= ((uint32_t)in[1]) << 8;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 1:
b |= ((uint32_t)in[0]);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 0:
break;
default:
case 'k': /* The hour (24-hour clock representation). */
LEGAL_ALT(0);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'H':
LEGAL_ALT(ALT_O);
if (!(conv_num(&bp, &tm->tm_hour, 0, 23))) {
case 'l': /* The hour (12-hour clock representation). */
LEGAL_ALT(0);
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'I':
LEGAL_ALT(ALT_O);
if (!(conv_num(&bp, &tm->tm_hour, 1, 12))) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
"%s: %s", err, strbuf);
- /* fallthrough */
+ FALLTHROUGH;
case ENOBUFS:
inc_stats(manager->stats,
sock->statsindex[STATID_OPENFAIL]);
case DOIO_EOF:
dev->result = ISC_R_EOF;
- /* fallthrough */
+ FALLTHROUGH;
case DOIO_HARD:
case DOIO_SUCCESS:
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DOIO_HARD:
case DOIO_SUCCESS:
if (active) { /* We exited cleanly last time */
break;
}
- /* intentional fallthrough */
+ FALLTHROUGH;
default:
strerror_r(errno, strbuf, sizeof(strbuf));
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
return (s_dead);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case s_req_server_start:
case s_req_server:
if (ch == '/') {
return (s_http_host);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case s_http_host_v6_end:
if (ch == ':') {
return (s_http_host_port_start);
return (s_http_host_v6_end);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case s_http_host_v6_start:
if (isxdigit((unsigned char)ch) || ch == ':' || ch == '.') {
return (s_http_host_v6);
return (s_http_host_v6_end);
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case s_http_host_v6_zone_start:
/* RFC 6874 Zone ID consists of 1*( unreserved / pct-encoded) */
if (isalnum((unsigned char)ch) || ch == '%' || ch == '.' ||
case s_req_server_with_at:
found_at = 1;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case s_req_server:
uf = ISC_UF_HOST;
break;
need_retry = true;
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
isc_result = isc__errno2result(Error);
if (ctx->geoip->country != NULL) {
return (true);
}
- /* city db can answer these too, so: */
- /* FALLTHROUGH */
+ /* city db can answer these too, so: */
+ FALLTHROUGH;
case dns_geoip_region:
case dns_geoip_regionname:
case dns_geoip_city_countrycode:
break;
case ISC_R_SOFTQUOTA:
isc_quota_detach(&client->recursionquota);
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
return;
}
break;
case ISC_R_SOFTQUOTA:
isc_quota_detach(&client->recursionquota);
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
return;
}
break;
case DNS_RPZ_POLICY_NODATA:
qctx->nxrewrite = true;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DNS_RPZ_POLICY_DNS64:
result = DNS_R_NXRRSET;
qctx->rpz = true;
{
goto cleanup;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DNS_R_CNAME:
if (!qctx->resuming && !STALE(&rdataset) && rdataset.ttl == 0 &&
RECURSIONOK(qctx->client))