*: fix GCC 7 switch/case fallthrough warnings

Need a comment on these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2017-07-14 16:48:01 +02:00
parent 888efdbb5e
commit acd738fc7f
13 changed files with 35 additions and 12 deletions

View file

@ -1764,6 +1764,7 @@ aspath_reconcile_as4 ( struct aspath *aspath, struct aspath *as4path)
" across 2/4 ASN boundary somewhere, broken.."); " across 2/4 ASN boundary somewhere, broken..");
hops = seg->length; hops = seg->length;
} }
/* fallthru */
case AS_SEQUENCE: case AS_SEQUENCE:
cpasns = MIN(seg->length, hops); cpasns = MIN(seg->length, hops);
hops -= seg->length; hops -= seg->length;

View file

@ -350,6 +350,7 @@ bgp_timer_set (struct peer *peer)
BGP_TIMER_OFF (peer->t_gr_restart); BGP_TIMER_OFF (peer->t_gr_restart);
BGP_TIMER_OFF (peer->t_gr_stale); BGP_TIMER_OFF (peer->t_gr_stale);
BGP_TIMER_OFF (peer->t_pmax_restart); BGP_TIMER_OFF (peer->t_pmax_restart);
/* fallthru */
case Clearing: case Clearing:
BGP_TIMER_OFF (peer->t_start); BGP_TIMER_OFF (peer->t_start);
BGP_TIMER_OFF (peer->t_connect); BGP_TIMER_OFF (peer->t_connect);

View file

@ -399,6 +399,7 @@ main (int argc, char **argv)
case 'l': case 'l':
bgp_address = optarg; bgp_address = optarg;
/* listenon implies -n */ /* listenon implies -n */
/* fallthru */
case 'n': case 'n':
no_fib_flag = 1; no_fib_flag = 1;
break; break;

View file

@ -403,6 +403,7 @@ command_complete (struct graph *graph,
trace_matcher ("trivial_match\n"); trace_matcher ("trivial_match\n");
if (exact_match_exists && !last_token) if (exact_match_exists && !last_token)
break; break;
/* fallthru */
case exact_match: case exact_match:
trace_matcher ("exact_match\n"); trace_matcher ("exact_match\n");
if (last_token) if (last_token)

View file

@ -74,24 +74,34 @@ jhash (const void *key, u_int32_t length, u_int32_t initval)
{ {
case 11: case 11:
c += ((u_int32_t) k[10] << 24); c += ((u_int32_t) k[10] << 24);
/* fallthru */
case 10: case 10:
c += ((u_int32_t) k[9] << 16); c += ((u_int32_t) k[9] << 16);
/* fallthru */
case 9: case 9:
c += ((u_int32_t) k[8] << 8); c += ((u_int32_t) k[8] << 8);
/* fallthru */
case 8: case 8:
b += ((u_int32_t) k[7] << 24); b += ((u_int32_t) k[7] << 24);
/* fallthru */
case 7: case 7:
b += ((u_int32_t) k[6] << 16); b += ((u_int32_t) k[6] << 16);
/* fallthru */
case 6: case 6:
b += ((u_int32_t) k[5] << 8); b += ((u_int32_t) k[5] << 8);
/* fallthru */
case 5: case 5:
b += k[4]; b += k[4];
/* fallthru */
case 4: case 4:
a += ((u_int32_t) k[3] << 24); a += ((u_int32_t) k[3] << 24);
/* fallthru */
case 3: case 3:
a += ((u_int32_t) k[2] << 16); a += ((u_int32_t) k[2] << 16);
/* fallthru */
case 2: case 2:
a += ((u_int32_t) k[1] << 8); a += ((u_int32_t) k[1] << 8);
/* fallthru */
case 1: case 1:
a += k[0]; a += k[0];
}; };
@ -129,6 +139,7 @@ jhash2 (const u_int32_t *k, u_int32_t length, u_int32_t initval)
{ {
case 2: case 2:
b += k[1]; b += k[1];
/* fallthru */
case 1: case 1:
a += k[0]; a += k[0];
}; };

View file

@ -348,7 +348,7 @@ work_queue_run (struct thread *thread)
if (wq->spec.errorfunc) if (wq->spec.errorfunc)
wq->spec.errorfunc (wq, item); wq->spec.errorfunc (wq, item);
} }
/* fall through here is deliberate */ /* fallthru */
case WQ_SUCCESS: case WQ_SUCCESS:
default: default:
{ {

View file

@ -244,6 +244,7 @@ int nhrp_ext_reply(struct zbuf *zb, struct nhrp_packet_header *hdr, struct inter
default: default:
if (type & NHRP_EXTENSION_FLAG_COMPULSORY) if (type & NHRP_EXTENSION_FLAG_COMPULSORY)
goto err; goto err;
/* fallthru */
case NHRP_EXTENSION_FORWARD_TRANSIT_NHS: case NHRP_EXTENSION_FORWARD_TRANSIT_NHS:
case NHRP_EXTENSION_REVERSE_TRANSIT_NHS: case NHRP_EXTENSION_REVERSE_TRANSIT_NHS:
/* Supported compulsory extensions, and any /* Supported compulsory extensions, and any

View file

@ -133,7 +133,7 @@ static void nhrp_peer_ifp_notify(struct notifier_block *n, unsigned long cmd)
nhrp_vc_notify_add(p->vc, &p->vc_notifier, nhrp_peer_vc_notify); nhrp_vc_notify_add(p->vc, &p->vc_notifier, nhrp_peer_vc_notify);
__nhrp_peer_check(p); __nhrp_peer_check(p);
} }
/* Fall-through to post config update */ /* fallthru */ /* to post config update */
case NOTIFY_INTERFACE_ADDRESS_CHANGED: case NOTIFY_INTERFACE_ADDRESS_CHANGED:
notifier_call(&p->notifier_list, NOTIFY_PEER_IFCONFIG_CHANGED); notifier_call(&p->notifier_list, NOTIFY_PEER_IFCONFIG_CHANGED);
break; break;
@ -693,6 +693,7 @@ static void nhrp_peer_forward(struct nhrp_peer *p, struct nhrp_packet_parser *pp
/* FIXME: RFC says to just copy, but not /* FIXME: RFC says to just copy, but not
* append our selves to the transit NHS list */ * append our selves to the transit NHS list */
goto err; goto err;
/* fallthru */
case NHRP_EXTENSION_RESPONDER_ADDRESS: case NHRP_EXTENSION_RESPONDER_ADDRESS:
/* Supported compulsory extensions, and any /* Supported compulsory extensions, and any
* non-compulsory that is not explicitly handled, * non-compulsory that is not explicitly handled,
@ -855,6 +856,7 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb)
/* FIXME: send error-indication */ /* FIXME: send error-indication */
} }
} }
/* fallthru */ /* FIXME: double check, is this correct? */
case NHRP_ROUTE_OFF_NBMA: case NHRP_ROUTE_OFF_NBMA:
if (packet_types[hdr->type].handler) { if (packet_types[hdr->type].handler) {
packet_types[hdr->type].handler(&pp); packet_types[hdr->type].handler(&pp);

View file

@ -392,7 +392,7 @@ ospf6_dbdesc_recv_master (struct ospf6_header *oh,
return; return;
} }
/* else fall through to ExStart */ /* else fall through to ExStart */
/* fallthru */
case OSPF6_NEIGHBOR_EXSTART: case OSPF6_NEIGHBOR_EXSTART:
/* if neighbor obeys us as our slave, schedule negotiation_done /* if neighbor obeys us as our slave, schedule negotiation_done
and process LSA Headers. Otherwise, ignore this message */ and process LSA Headers. Otherwise, ignore this message */
@ -600,7 +600,7 @@ ospf6_dbdesc_recv_slave (struct ospf6_header *oh,
return; return;
} }
/* else fall through to ExStart */ /* else fall through to ExStart */
/* fallthru */
case OSPF6_NEIGHBOR_EXSTART: case OSPF6_NEIGHBOR_EXSTART:
/* If the neighbor is Master, act as Slave. Schedule negotiation_done /* If the neighbor is Master, act as Slave. Schedule negotiation_done
and process LSA Headers. Otherwise, ignore this message */ and process LSA Headers. Otherwise, ignore this message */

View file

@ -493,6 +493,7 @@ ospfv3GeneralGroup (struct variable *v, oid *name, size_t *length,
if (ospf6) if (ospf6)
return SNMP_INTEGER (ospf6->ref_bandwidth); return SNMP_INTEGER (ospf6->ref_bandwidth);
/* Otherwise, like for "not implemented". */ /* Otherwise, like for "not implemented". */
/* fallthru */
case OSPFv3RESTARTSUPPORT: case OSPFv3RESTARTSUPPORT:
case OSPFv3RESTARTINTERVAL: case OSPFv3RESTARTINTERVAL:
case OSPFv3RESTARTSTRICTLSACHECKING: case OSPFv3RESTARTSTRICTLSACHECKING:

View file

@ -1033,6 +1033,7 @@ ospf_vl_set_params (struct ospf_vl_data *vl_data, struct vertex *v)
case LSA_LINK_TYPE_VIRTUALLINK: case LSA_LINK_TYPE_VIRTUALLINK:
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("found back link through VL"); zlog_debug ("found back link through VL");
/* fallthru */
case LSA_LINK_TYPE_TRANSIT: case LSA_LINK_TYPE_TRANSIT:
case LSA_LINK_TYPE_POINTOPOINT: case LSA_LINK_TYPE_POINTOPOINT:
if (!IPV4_ADDR_SAME (&vl_data->peer_addr, if (!IPV4_ADDR_SAME (&vl_data->peer_addr,

View file

@ -113,6 +113,7 @@ nsm_timer_set (struct ospf_neighbor *nbr)
case NSM_Down: case NSM_Down:
OSPF_NSM_TIMER_OFF (nbr->t_inactivity); OSPF_NSM_TIMER_OFF (nbr->t_inactivity);
OSPF_NSM_TIMER_OFF (nbr->t_hello_reply); OSPF_NSM_TIMER_OFF (nbr->t_hello_reply);
/* fallthru */
case NSM_Attempt: case NSM_Attempt:
case NSM_Init: case NSM_Init:
case NSM_TwoWay: case NSM_TwoWay:

View file

@ -1152,6 +1152,7 @@ ospf_db_desc_proc (struct stream *s, struct ospf_interface *oi,
case -1: case -1:
/* Neighbour has a more recent LSA, we must request it */ /* Neighbour has a more recent LSA, we must request it */
ospf_ls_request_add (nbr, new); ospf_ls_request_add (nbr, new);
/* fallthru */
case 0: case 0:
/* If we have a copy of this LSA, it's either less recent /* If we have a copy of this LSA, it's either less recent
* and we're requesting it from neighbour (the case above), or * and we're requesting it from neighbour (the case above), or
@ -1327,6 +1328,7 @@ ospf_db_desc (struct ip *iph, struct ospf_header *ospfh,
through to case ExStart below. */ through to case ExStart below. */
if (nbr->state != NSM_ExStart) if (nbr->state != NSM_ExStart)
break; break;
/* fallthru */
case NSM_ExStart: case NSM_ExStart:
/* Initial DBD */ /* Initial DBD */
if ((IS_SET_DD_ALL (dd->flags) == OSPF_DD_FLAG_ALL) && if ((IS_SET_DD_ALL (dd->flags) == OSPF_DD_FLAG_ALL) &&