Skip to content

Commit

Permalink
- Fix gcc 7.1.1 warnings.
Browse files Browse the repository at this point in the history
git-svn-id: file:///svn/nsd/trunk@4767 a26ef69c-88ff-0310-839f-98b793d9c207
  • Loading branch information
wcawijngaards committed Jul 24, 2017
1 parent 5dcf261 commit 1483ebe
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions axfr.c
Expand Up @@ -201,6 +201,7 @@ answer_axfr_ixfr(struct nsd *nsd, struct query *q)
return query_axfr(nsd, q);
}
/** Fallthrough: AXFR over UDP queries are discarded. */
/* fallthrough */
case TYPE_IXFR:
RCODE_SET(q->packet, RCODE_IMPL);
return QUERY_PROCESSED;
Expand Down
3 changes: 3 additions & 0 deletions doc/ChangeLog
@@ -1,3 +1,6 @@
24 July 2016: Wouter
- Fix gcc 7.1.1 warnings.

17 July 2016: Wouter
- Trunk has 4.1.18
- xfr-inspect is part of source dir, but not made or installed by
Expand Down
1 change: 1 addition & 0 deletions doc/RELNOTES
Expand Up @@ -7,6 +7,7 @@ FEATURES:
made with 'make xfr-inspect' in the source dir.
- retry timeout between sending notifies dropped from 15 to 3 sec.
BUG FIXES:
- Fix gcc 7.1.1 warnings.


4.1.17
Expand Down
14 changes: 14 additions & 0 deletions lookup3.c
Expand Up @@ -5,6 +5,7 @@
added #ifdef VALGRIND to remove 298,384,660 'unused variable k8' warnings.
added include of lookup3.h to check definitions match declarations.
removed include of stdint - config.h takes care of platform independence.
added fallthrough comments for new gcc warning suppression.
url http://burtleburtle.net/bob/hash/index.html.
*/
/*
Expand Down Expand Up @@ -235,7 +236,9 @@ uint32_t initval) /* the previous hash, or an arbitrary value */
switch(length) /* all the case statements fall through */
{
case 3 : c+=k[2];
/* fallthrough */
case 2 : b+=k[1];
/* fallthrough */
case 1 : a+=k[0];
final(a,b,c);
case 0: /* case 0: nothing left to add */
Expand Down Expand Up @@ -473,16 +476,27 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
switch(length) /* all the case statements fall through */
{
case 12: c+=((uint32_t)k[11])<<24;
/* fallthrough */
case 11: c+=((uint32_t)k[10])<<16;
/* fallthrough */
case 10: c+=((uint32_t)k[9])<<8;
/* fallthrough */
case 9 : c+=k[8];
/* fallthrough */
case 8 : b+=((uint32_t)k[7])<<24;
/* fallthrough */
case 7 : b+=((uint32_t)k[6])<<16;
/* fallthrough */
case 6 : b+=((uint32_t)k[5])<<8;
/* fallthrough */
case 5 : b+=k[4];
/* fallthrough */
case 4 : a+=((uint32_t)k[3])<<24;
/* fallthrough */
case 3 : a+=((uint32_t)k[2])<<16;
/* fallthrough */
case 2 : a+=((uint32_t)k[1])<<8;
/* fallthrough */
case 1 : a+=k[0];
break;
case 0 : return c;
Expand Down
2 changes: 2 additions & 0 deletions nsd.c
Expand Up @@ -579,6 +579,7 @@ main(int argc, char *argv[])
case 'v':
version();
/* version exits */
break;
#ifndef NDEBUG
case 'F':
sscanf(optarg, "%x", &nsd_debug_facilities);
Expand Down Expand Up @@ -980,6 +981,7 @@ main(int argc, char *argv[])
break;
case -1:
error("fork() failed: %s", strerror(errno));
break;
default:
/* Parent is done */
server_close_all_sockets(nsd.udp, nsd.ifs);
Expand Down
4 changes: 2 additions & 2 deletions rrl.c
Expand Up @@ -156,7 +156,7 @@ static const char* rrlsource2str(uint64_t s, uint16_t c2)
if(!inet_ntop(AF_INET6, &a6, buf, sizeof(buf)))
strlcpy(buf, "[ip6 ntop failed]", sizeof(buf));
else {
static char prefix[4];
static char prefix[5];
snprintf(prefix, sizeof(prefix), "/%d", rrl_ipv6_prefixlen);
strlcat(buf, &prefix[0], sizeof(buf));
}
Expand All @@ -170,7 +170,7 @@ static const char* rrlsource2str(uint64_t s, uint16_t c2)
if(!inet_ntop(AF_INET, &a4, buf, sizeof(buf)))
strlcpy(buf, "[ip4 ntop failed]", sizeof(buf));
else {
static char prefix[4];
static char prefix[5];
snprintf(prefix, sizeof(prefix), "/%d", rrl_ipv4_prefixlen);
strlcat(buf, &prefix[0], sizeof(buf));
}
Expand Down
1 change: 1 addition & 0 deletions xfrd-tcp.c
Expand Up @@ -898,6 +898,7 @@ xfrd_tcp_read(struct xfrd_tcp_pipeline* tp)
tp->id[zone->query_id] = TCP_NULL_SKIP;
tp->num_skip++;
/* fall through to remove zone from tp */
/* fallthrough */
case xfrd_packet_transfer:
if(zone->zone_options->pattern->multi_master_check) {
xfrd_tcp_release(xfrd->tcp_set, zone);
Expand Down
1 change: 1 addition & 0 deletions xfrd.c
Expand Up @@ -1323,6 +1323,7 @@ xfrd_udp_read(xfrd_zone_type* zone)
xfrd_make_request(zone);
break;
}
/* fallthrough */
case xfrd_packet_newlease:
/* nothing more to do */
assert(zone->round_num == -1);
Expand Down

0 comments on commit 1483ebe

Please sign in to comment.