From 45ef43000030a5801efc6c158786595c31355335 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 15 Nov 2016 11:17:50 +0900 Subject: [PATCH] build: fix -Wmaybe-uninitialized warnings Signed-off-by: David Lamparter --- bgpd/bgp_vty.c | 2 ++ lib/bitfield.h | 2 +- lib/command.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 4232ff8d9a..4164318220 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -13660,6 +13660,8 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) af_str = "IPv4"; else if (afi == AFI_IP6) af_str = "IPv6"; + else + af_str = "???"; lr_count = listcount(group->listen_range[afi]); if (lr_count) { diff --git a/lib/bitfield.h b/lib/bitfield.h index b3f40a948b..5bf2c8bd06 100644 --- a/lib/bitfield.h +++ b/lib/bitfield.h @@ -86,7 +86,7 @@ typedef unsigned int word_t; /* Find a clear bit in v and assign it to b. */ #define bf_find_bit(v, b) \ do { \ - word_t word; \ + word_t word = 0; \ unsigned int w, sh; \ for (w = 0; w <= (v).n; w++) { \ if ((word = (v).data[w]) != WORD_MAX) break; \ diff --git a/lib/command.c b/lib/command.c index e8ba637623..cfadfcef62 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2089,7 +2089,7 @@ cmd_describe_command_real (vector vline, struct vty *vty, int *status) unsigned int index; int ret; enum match_type match; - char *command; + char *command = NULL; vector matches = NULL; vector match_vector; uint32_t command_found = 0; -- 2.39.5