From a4e825411a66bbf4acc779396e8d3939ecf48abe Mon Sep 17 00:00:00 2001 From: Jan Maria Matejka Date: Tue, 18 Sep 2018 14:21:11 +0200 Subject: [PATCH] No more warnings ... no more warnings No more warnings over me And while it is being compiled all the log is black and white Release BIRD now and then let it flee (use the melody of well-known Oh Freedom!) --- lib/printf.c | 1 + nest/a-path.c | 2 +- proto/bfd/packets.c | 2 ++ proto/ospf/dbdes.c | 1 + proto/ospf/ospf.c | 1 + proto/ospf/packet.c | 1 + proto/radv/radv.c | 1 + proto/rip/packets.c | 18 +++++++++++------- sysdep/unix/io.c | 12 ++++++------ sysdep/unix/krt.c | 3 ++- 10 files changed, 27 insertions(+), 15 deletions(-) diff --git a/lib/printf.c b/lib/printf.c index 533a1300..918e95f8 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -413,6 +413,7 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args) case 'X': flags |= LARGE; + /* fallthrough */ case 'x': base = 16; break; diff --git a/nest/a-path.c b/nest/a-path.c index 6bad9747..6f1c40bf 100644 --- a/nest/a-path.c +++ b/nest/a-path.c @@ -805,7 +805,7 @@ as_path_match(const struct adata *path, struct f_path_mask *mask) val2 = val = mask->val; goto step; case PM_ASN_EXPR: - ASSERT(0); + bug("Expressions should be evaluated on AS path mask construction."); case PM_ASN_RANGE: val = mask->val; val2 = mask->val2; diff --git a/proto/bfd/packets.c b/proto/bfd/packets.c index b76efda6..6d5151ea 100644 --- a/proto/bfd/packets.c +++ b/proto/bfd/packets.c @@ -141,6 +141,7 @@ bfd_fill_authentication(struct bfd_proto *p, struct bfd_session *s, struct bfd_c case BFD_AUTH_METICULOUS_KEYED_MD5: case BFD_AUTH_METICULOUS_KEYED_SHA1: meticulous = 1; + /* fallthrough */ case BFD_AUTH_KEYED_MD5: case BFD_AUTH_KEYED_SHA1: @@ -230,6 +231,7 @@ bfd_check_authentication(struct bfd_proto *p, struct bfd_session *s, struct bfd_ case BFD_AUTH_METICULOUS_KEYED_MD5: case BFD_AUTH_METICULOUS_KEYED_SHA1: meticulous = 1; + /* fallthrough */ case BFD_AUTH_KEYED_MD5: case BFD_AUTH_KEYED_SHA1: diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c index 59490931..67a75f8e 100644 --- a/proto/ospf/dbdes.c +++ b/proto/ospf/dbdes.c @@ -352,6 +352,7 @@ ospf_receive_dbdes(struct ospf_packet *pkt, struct ospf_iface *ifa, ospf_neigh_sm(n, INM_2WAYREC); if (n->state != NEIGHBOR_EXSTART) return; + /* fallthrough */ case NEIGHBOR_EXSTART: if ((ifa->type != OSPF_IT_VLINK) && diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 07708e4f..5ac75d89 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -1220,6 +1220,7 @@ ospf_sh_state(struct proto *P, int verbose, int reachable) he->domain = 1; /* Abuse domain field to mark the LSA */ hex[jx++] = he; } + /* fallthrough */ default: accept = 0; } diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c index b0bbaae1..fff621dc 100644 --- a/proto/ospf/packet.c +++ b/proto/ospf/packet.c @@ -58,6 +58,7 @@ ospf_pkt_finalize(struct ospf_iface *ifa, struct ospf_packet *pkt, uint *plen) return; } strncpy(auth->password, pass->password, sizeof(auth->password)); + /* fallthrough */ case OSPF_AUTH_NONE: { diff --git a/proto/radv/radv.c b/proto/radv/radv.c index 8a79dfaf..65e10d58 100644 --- a/proto/radv/radv.c +++ b/proto/radv/radv.c @@ -230,6 +230,7 @@ radv_iface_notify(struct radv_iface *ifa, int event) { case RA_EV_CHANGE: radv_invalidate(ifa); + /* fallthrough */ case RA_EV_INIT: ifa->initial = MAX_INITIAL_RTR_ADVERTISEMENTS; radv_prepare_prefixes(ifa); diff --git a/proto/rip/packets.c b/proto/rip/packets.c index 891f454f..7e176a1e 100644 --- a/proto/rip/packets.c +++ b/proto/rip/packets.c @@ -58,13 +58,17 @@ struct rip_block_auth { u16 must_be_ffff; u16 auth_type; - char password[0]; - u16 packet_len; - u8 key_id; - u8 auth_len; - u32 seq_num; - u32 unused1; - u32 unused2; + union { + char password[16]; + struct { + u16 packet_len; + u8 key_id; + u8 auth_len; + u32 seq_num; + u32 unused1; + u32 unused2; + }; + }; }; /* Authentication tail, RFC 4822 */ diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 012deaf0..1fb0aa9e 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -1128,7 +1128,7 @@ sk_ssh_connect(sock *s) default: return SSH_ERROR; } - } + } /* fallthrough */ case SK_SSH_SERVER_KNOWN: { @@ -1175,7 +1175,7 @@ sk_ssh_connect(sock *s) if (!server_identity_is_ok) return SSH_ERROR; } - } + } /* fallthrough */ case SK_SSH_USERAUTH: { @@ -1191,7 +1191,7 @@ sk_ssh_connect(sock *s) default: return SSH_ERROR; } - } + } /* fallthrough */ case SK_SSH_CHANNEL: { @@ -1199,7 +1199,7 @@ sk_ssh_connect(sock *s) s->ssh->channel = ssh_channel_new(s->ssh->session); if (s->ssh->channel == NULL) return SSH_ERROR; - } + } /* fallthrough */ case SK_SSH_SESSION: { @@ -1215,7 +1215,7 @@ sk_ssh_connect(sock *s) default: return SSH_ERROR; } - } + } /* fallthrough */ case SK_SSH_SUBSYSTEM: { @@ -1234,7 +1234,7 @@ sk_ssh_connect(sock *s) return SSH_ERROR; } } - } + } /* fallthrough */ case SK_SSH_ESTABLISHED: s->ssh->state = SK_SSH_ESTABLISHED; diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index b4fb1967..13c16014 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -788,7 +788,8 @@ krt_got_route_async(struct krt_proto *p, rte *e, int new) switch (e->u.krt.src) { case KRT_SRC_BIRD: - ASSERT(0); /* Should be filtered by the back end */ + /* Should be filtered by the back end */ + bug("BIRD originated routes should not get here."); case KRT_SRC_REDIRECT: if (new)