diff --git a/CHANGES b/CHANGES index d7d716dd70..c60cb61bb6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +4673. [port] Silence GCC 7 warnings. [RT #45592] + 4672. [bug] Fix a regression introduced by change 3938 (when --enable-fetchlimit is NOT in use), where named as resolver would, upon fetch timeout, repeat diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 56ddee0d05..65ef1ab572 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -319,7 +319,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) { @@ -338,10 +338,11 @@ 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); - snprintf(store, 19, " in %d ms.", (int)diff/1000); + snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000); ADD_STRING(buf, store); } ADD_STRING(buf, "\n"); diff --git a/bin/dnssec/dnssec-revoke.c b/bin/dnssec/dnssec-revoke.c index 4e2a18a936..a08e103862 100644 --- a/bin/dnssec/dnssec-revoke.c +++ b/bin/dnssec/dnssec-revoke.c @@ -138,7 +138,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(); diff --git a/bin/dnssec/dnssec-settime.c b/bin/dnssec/dnssec-settime.c index ba83b8e258..a118a7a86c 100644 --- a/bin/dnssec/dnssec-settime.c +++ b/bin/dnssec/dnssec-settime.c @@ -299,7 +299,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(); diff --git a/bin/dnssec/dnssectool.h b/bin/dnssec/dnssectool.h index 2ad83d3d86..98ded5967c 100644 --- a/bin/dnssec/dnssectool.h +++ b/bin/dnssec/dnssectool.h @@ -45,8 +45,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); diff --git a/lib/bind9/getaddresses.c b/lib/bind9/getaddresses.c index e17027333a..647089ab47 100644 --- a/lib/bind9/getaddresses.c +++ b/lib/bind9/getaddresses.c @@ -163,6 +163,7 @@ bind9_getaddresses(const char *hostname, in_port_t port, goto again; } #endif + /* FALLTHROUGH */ default: return (ISC_R_FAILURE); } diff --git a/lib/dns/rootns.c b/lib/dns/rootns.c index 82df5ac22a..03ba9bbbf5 100644 --- a/lib/dns/rootns.c +++ b/lib/dns/rootns.c @@ -131,7 +131,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; diff --git a/lib/dns/time.c b/lib/dns/time.c index 5dce072811..6e2c9e3fcd 100644 --- a/lib/dns/time.c +++ b/lib/dns/time.c @@ -40,7 +40,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; diff --git a/lib/dns/update.c b/lib/dns/update.c index 9ad90ec6b1..64516a6a31 100644 --- a/lib/dns/update.c +++ b/lib/dns/update.c @@ -1546,7 +1546,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; @@ -1579,7 +1579,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; /* @@ -1667,7 +1667,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; @@ -1784,7 +1784,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. */ @@ -1814,7 +1814,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; @@ -1902,7 +1902,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) { @@ -1957,7 +1957,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. */ diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 34809732b4..309cfd36d5 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -622,6 +622,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; diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 4208361b5a..8c5335d505 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -9063,6 +9063,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); @@ -9084,6 +9085,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) && @@ -14101,7 +14103,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); /* diff --git a/lib/isc/entropy.c b/lib/isc/entropy.c index 66c196e5f7..3a5e235f8d 100644 --- a/lib/isc/entropy.c +++ b/lib/isc/entropy.c @@ -331,9 +331,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--; @@ -354,8 +356,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++; } diff --git a/lib/isc/print.c b/lib/isc/print.c index 6b7bba2145..c68d937e6a 100644 --- a/lib/isc/print.c +++ b/lib/isc/print.c @@ -639,7 +639,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': diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c index 9c422b55a3..a8c348974f 100644 --- a/lib/isc/unix/entropy.c +++ b/lib/isc/unix/entropy.c @@ -160,7 +160,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) { @@ -198,7 +198,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) { diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 7bd4739388..43fdad28ec 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -4879,6 +4879,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) diff --git a/lib/lwres/print.c b/lib/lwres/print.c index 6346c718c3..44770eae02 100644 --- a/lib/lwres/print.c +++ b/lib/lwres/print.c @@ -506,7 +506,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':