Commit cdacec1d authored by Evan Hunt's avatar Evan Hunt
Browse files

[master] silence gcc 7 warnings

4673.	[port]		Silence GCC 7 warnings. [RT #45592]
parent 31605091
4673. [port] Silence GCC 7 warnings. [RT #45592]
4672. [placeholder]
4671. [bug] Fix a race condition that could cause the
......
......@@ -325,7 +325,7 @@ static isc_result_t
say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
isc_result_t result;
isc_uint64_t diff;
char store[sizeof("12345678901234567890")];
char store[sizeof(" in 18446744073709551616 us.")];
unsigned int styleflags = 0;
if (query->lookup->trace || query->lookup->ns_search_only) {
......@@ -348,13 +348,14 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
return (result);
check_result(result, "dns_rdata_totext");
if (query->lookup->identify) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
ADD_STRING(buf, " from server ");
ADD_STRING(buf, query->servname);
if (query->lookup->use_usec)
snprintf(store, 19, " in %ld us.", (long) diff);
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u us.", diff);
else
snprintf(store, 19, " in %ld ms.", (long) diff / 1000);
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000);
ADD_STRING(buf, store);
}
ADD_STRING(buf, "\n");
......
......@@ -140,7 +140,7 @@ main(int argc, char **argv) {
if (isc_commandline_option != '?')
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
/* Falls into */
/* FALLTHROUGH */
case 'h':
/* Does not return. */
usage();
......
......@@ -348,7 +348,7 @@ main(int argc, char **argv) {
if (isc_commandline_option != '?')
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
/* Falls into */
/* FALLTHROUGH */
case 'h':
/* Does not return. */
usage();
......
......@@ -36,8 +36,8 @@ check_result(isc_result_t result, const char *message);
void
vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
void
version(const char *program);
ISC_PLATFORM_NORETURN_PRE void
version(const char *program) ISC_PLATFORM_NORETURN_POST;
void
type_format(const dns_rdatatype_t type, char *cp, unsigned int size);
......
......@@ -9283,7 +9283,7 @@ log_query(ns_client_t *client, unsigned int flags, unsigned int extflags) {
char classname[DNS_RDATACLASS_FORMATSIZE];
char onbuf[ISC_NETADDR_FORMATSIZE];
char ecsbuf[DNS_ECS_FORMATSIZE + sizeof(" [ECS ]") - 1] = { 0 };
char ednsbuf[sizeof("E(255)")] = { 0 };
char ednsbuf[sizeof("E(65535)")] = { 0 };
dns_rdataset_t *rdataset;
int level = ISC_LOG_INFO;
......@@ -9298,7 +9298,7 @@ log_query(ns_client_t *client, unsigned int flags, unsigned int extflags) {
isc_netaddr_format(&client->destaddr, onbuf, sizeof(onbuf));
if (client->ednsversion >= 0)
snprintf(ednsbuf, sizeof(ednsbuf), "E(%d)",
snprintf(ednsbuf, sizeof(ednsbuf), "E(%hd)",
client->ednsversion);
if (HAVEECS(client)) {
......
......@@ -30,6 +30,9 @@ static isc_lex_t *lex;
static isc_lexspecials_t specials;
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
fprintf(stderr, "usage: named-rrchecker [-o origin] [-hpCPTu]\n");
......
......@@ -154,6 +154,7 @@ bind9_getaddresses(const char *hostname, in_port_t port,
goto again;
}
#endif
/* FALLTHROUGH */
default:
return (ISC_R_FAILURE);
}
......
......@@ -7042,6 +7042,7 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
case dns_rcode_formerr:
if (fctx->rmessage->counts[DNS_SECTION_QUESTION] == 0)
break;
/* FALLTHROUGH */
case dns_rcode_nxrrset: /* Not expected. */
case dns_rcode_badcookie:
case dns_rcode_noerror:
......
......@@ -122,7 +122,7 @@ check_node(dns_rdataset_t *rootns, dns_name_t *name,
case dns_rdatatype_ns:
if (dns_name_compare(name, dns_rootname) == 0)
break;
/*FALLTHROUGH*/
/* FALLTHROUGH */
default:
result = ISC_R_FAILURE;
goto cleanup;
......
......@@ -31,7 +31,7 @@ static const int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
isc_result_t
dns_time64_totext(isc_int64_t t, isc_buffer_t *target) {
struct tm tm;
char buf[sizeof("YYYYMMDDHHMMSS")];
char buf[sizeof("!!!!!!YYYY!!!!!!!!MM!!!!!!!!DD!!!!!!!!HH!!!!!!!!MM!!!!!!!!SS")];
int secs;
unsigned int l;
isc_region_t region;
......
......@@ -1539,7 +1539,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
update_log(log, zone, ISC_LOG_DEBUG(3),
"updated data signatures");
/*FALLTHROUGH*/
/* FALLTHROUGH */
case remove_orphaned:
state->state = remove_orphaned;
......@@ -1572,7 +1572,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
update_log(log, zone, ISC_LOG_DEBUG(3),
"rebuilding NSEC chain");
/*FALLTHROUGH*/
/* FALLTHROUGH */
case build_chain:
state->state = build_chain;
/*
......@@ -1660,7 +1660,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
CHECK(uniqify_name_list(&state->affected));
/*FALLTHROUGH*/
/* FALLTHROUGH */
case process_nsec:
state->state = process_nsec;
......@@ -1777,7 +1777,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
update_log(log, zone, ISC_LOG_DEBUG(3),
"signing rebuilt NSEC chain");
/*FALLTHROUGH*/
/* FALLTHROUGH */
case sign_nsec:
state->state = sign_nsec;
/* Update RRSIG NSECs. */
......@@ -1807,7 +1807,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
}
ISC_LIST_APPENDLIST(state->nsec_mindiff.tuples,
state->work.tuples, link);
/*FALLTHROUGH*/
/* FALLTHROUGH */
case update_nsec3:
state->state = update_nsec3;
......@@ -1895,7 +1895,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
t = ISC_LIST_NEXT(t, link);
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case process_nsec3:
state->state = process_nsec3;
while ((t = ISC_LIST_HEAD(state->affected.tuples)) != NULL) {
......@@ -1950,7 +1950,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
update_log(log, zone, ISC_LOG_DEBUG(3),
"signing rebuilt NSEC3 chain");
/*FALLTHROUGH*/
/* FALLTHROUGH */
case sign_nsec3:
state->state = sign_nsec3;
/* Update RRSIG NSEC3s. */
......
......@@ -615,6 +615,7 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl,
case XFRST_IXFR_END:
FAIL(DNS_R_EXTRADATA);
/* NOTREACHED */
/* FALLTHROUGH */
default:
INSIST(0);
break;
......
......@@ -9570,6 +9570,7 @@ zone_maintenance(dns_zone_t *zone) {
case dns_zone_redirect:
if (zone->masters == NULL)
break;
/* FALLTHROUGH */
case dns_zone_slave:
case dns_zone_stub:
LOCK_ZONE(zone);
......@@ -9591,6 +9592,7 @@ zone_maintenance(dns_zone_t *zone) {
case dns_zone_redirect:
if (zone->masters == NULL)
break;
/* FALLTHROUGH */
case dns_zone_slave:
case dns_zone_stub:
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_DIALREFRESH) &&
......@@ -14780,7 +14782,7 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
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);
/*
......
......@@ -325,9 +325,11 @@ entropypool_adddata(isc_entropy_t *ent, void *p, unsigned int len,
case 3:
val = *buf++;
len--;
/* FALLTHROUGH */
case 2:
val = val << 8 | *buf++;
len--;
/* FALLTHROUGH */
case 1:
val = val << 8 | *buf++;
len--;
......@@ -348,8 +350,10 @@ entropypool_adddata(isc_entropy_t *ent, void *p, unsigned int len,
switch (len) {
case 3:
val = *buf++;
/* FALLTHROUGH */
case 2:
val = val << 8 | *buf++;
/* FALLTHROUGH */
case 1:
val = val << 8 | *buf++;
}
......
......@@ -630,7 +630,7 @@ isc__print_printf(void (*emit)(char, void *), void *arg,
#else
assert("long doubles are not supported" == NULL);
#endif
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'e':
case 'E':
case 'f':
......
......@@ -151,7 +151,7 @@ get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
INSIST(n == 2);
source->sources.usocket.status =
isc_usocketsource_wrote;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case isc_usocketsource_wrote:
if (recvfrom(fd, buf, 1, 0, NULL, NULL) != 1) {
......@@ -189,7 +189,7 @@ get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
source->sources.usocket.sz_to_recv = sz_to_recv;
if (sz_to_recv > sizeof(buf))
goto err;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case isc_usocketsource_reading:
if (sz_to_recv != 0U) {
......
......@@ -5220,6 +5220,8 @@ socket_send(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
break;
}
/* FALLTHROUGH */
case DOIO_HARD:
case DOIO_SUCCESS:
if ((flags & ISC_SOCKFLAG_IMMEDIATE) == 0)
......
......@@ -412,23 +412,27 @@ geoip_can_answer(dns_aclelement_t *elt, cfg_aclconfctx_t *ctx) {
ctx->geoip->country_v6 != NULL ||
ctx->geoip->region != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_region:
case dns_geoip_regionname:
if (ctx->geoip->city_v4 != NULL ||
ctx->geoip->city_v6 != NULL ||
ctx->geoip->region != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_country_code:
case dns_geoip_country_code3:
case dns_geoip_country_name:
if (ctx->geoip->country_v4 != NULL ||
ctx->geoip->country_v6 != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_region_countrycode:
case dns_geoip_region_code:
case dns_geoip_region_name:
if (ctx->geoip->region != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_city_countrycode:
case dns_geoip_city_countrycode3:
case dns_geoip_city_countryname:
......@@ -443,18 +447,23 @@ geoip_can_answer(dns_aclelement_t *elt, cfg_aclconfctx_t *ctx) {
if (ctx->geoip->city_v4 != NULL ||
ctx->geoip->city_v6 != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_isp_name:
if (ctx->geoip->isp != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_org_name:
if (ctx->geoip->org != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_as_asnum:
if (ctx->geoip->as != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_domain_name:
if (ctx->geoip->domain != NULL)
return (ISC_TRUE);
/* FALLTHROUGH */
case dns_geoip_netspeed_id:
if (ctx->geoip->netspeed != NULL)
return (ISC_TRUE);
......
......@@ -497,7 +497,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
#else
INSIST("long doubles are not supported" == NULL);
#endif
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'e':
case 'E':
case 'f':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment