GCC 6 can now give warnings when the indentation of code does not align with the scope of prior control flow statement(s). I.e., where the code visually suggests one kind of control flow, but in actuality follows another.
Fix warnings found. They all seem to be simple cases of the indentation being deceptive, but the existing flow being correct. --- bgpd/bgp_route.c | 16 ++++++++-------- bgpd/bgpd.c | 22 +++++++++++----------- isisd/topology/spgrid.c | 7 ++++--- ospf6d/ospf6_interface.c | 2 +- ospfd/ospf_abr.c | 12 ++++++------ 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index a88a022..c74982f 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -16224,14 +16224,14 @@ bgp_config_write_distance (struct vty *vty, struct bgp *bgp, bgp->ipv6_distance_ebgp, bgp->ipv6_distance_ibgp, bgp->ipv6_distance_local, VTY_NEWLINE); - for (rn = bgp_table_top (bgp_distance_table); rn; rn = bgp_route_next (rn)) - if ((bdistance = rn->info) != NULL) - { - vty_out (vty, " distance %d %s/%d %s%s", bdistance->distance, - inet6_ntoa (rn->p.u.prefix6), rn->p.prefixlen, - bdistance->access_list ? bdistance->access_list : "", - VTY_NEWLINE); - } + for (rn = bgp_table_top (bgp_distance_table); rn; rn = bgp_route_next (rn)) + if ((bdistance = rn->info) != NULL) + { + vty_out (vty, " distance %d %s/%d %s%s", bdistance->distance, + inet6_ntoa (rn->p.u.prefix6), rn->p.prefixlen, + bdistance->access_list ? bdistance->access_list : "", + VTY_NEWLINE); + } } #endif /* HAVE_IPV6 */ diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index eacf804..9114cc7 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3972,19 +3972,19 @@ peer_distribute_unset (struct peer *peer, afi_t afi, safi_t safi, int direct) if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)) return 0; - group = peer->group; - for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) - { - filter = &peer->filter[afi][safi]; + group = peer->group; + for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) + { + filter = &peer->filter[afi][safi]; - if (! peer->af_group[afi][safi]) - continue; + if (! peer->af_group[afi][safi]) + continue; - if (filter->dlist[direct].name) - free (filter->dlist[direct].name); - filter->dlist[direct].name = NULL; - filter->dlist[direct].alist = NULL; - } + if (filter->dlist[direct].name) + free (filter->dlist[direct].name); + filter->dlist[direct].name = NULL; + filter->dlist[direct].alist = NULL; + } return 0; } diff --git a/isisd/topology/spgrid.c b/isisd/topology/spgrid.c index 22cfa7b..e1c87ab 100644 --- a/isisd/topology/spgrid.c +++ b/isisd/topology/spgrid.c @@ -598,7 +598,7 @@ gen_spgrid_topology (struct vty *vty, struct list *topology) init_rand ( seed1); pl = pl - pm + 1; - for ( x = 0; x < X; x ++ ) + for ( x = 0; x < X; x ++ ) { for ( y = 0; y < Y; y ++ ) { p_t = pm + nrand ( pl ); if ( pn_f ) p_t *= (long) ( (1 + x) * pn ); @@ -606,9 +606,10 @@ gen_spgrid_topology (struct vty *vty, struct list *topology) p[ NODE ( x, y ) ] = p_t; } - p[n0] = 0; - if ( s_f ) p[n0-1] = 0; } + p[n0] = 0; + if ( s_f ) p[n0-1] = 0; + } if ( s_f ) /* additional arcs from artifical source */ { diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 3d6ebcd..b033b6c 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -704,7 +704,7 @@ interface_up (struct thread *thread) if (IS_OSPF6_DEBUG_INTERFACE) zlog_debug ("Interface %s has no link local address, can't execute [InterfaceUp]", oi->interface->name); - return 0; + return 0; } /* Recompute cost */ diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c index e172e53..95c2d46 100644 --- a/ospfd/ospf_abr.c +++ b/ospfd/ospf_abr.c @@ -701,7 +701,7 @@ ospf_abr_translate_nssa (struct ospf_area *area, struct ospf_lsa *lsa) zlog_debug ("ospf_abr_translate_nssa(): Could not translate " "Type-7 for %s to Type-5", inet_ntoa (lsa->data->id)); - return 1; + return 1; } } @@ -948,11 +948,11 @@ ospf_abr_announce_network (struct ospf *ospf, zlog_debug ("ospf_abr_announce_network(): " "this is intra-area route to %s/%d", inet_ntoa (p->prefix), p->prefixlen); - if ((range = ospf_area_range_match (or_area, p)) - && !ospf_area_is_transit (area)) - ospf_abr_update_aggregate (range, or, area); - else - ospf_abr_announce_network_to_area (p, or->cost, area); + if ((range = ospf_area_range_match (or_area, p)) + && !ospf_area_is_transit (area)) + ospf_abr_update_aggregate (range, or, area); + else + ospf_abr_announce_network_to_area (p, or->cost, area); } } } -- 2.5.5 _______________________________________________ Quagga-dev mailing list Quagga-dev@lists.quagga.net https://lists.quagga.net/mailman/listinfo/quagga-dev