From: Renato Westphal Date: Fri, 2 Feb 2018 17:10:09 +0000 (-0200) Subject: *: silence '-Wmaybe-uninitialized' warnings on NetBSD X-Git-Tag: frr-4.0-dev~8^2~2 X-Git-Url: https://git.proxmox.com/?p=mirror_frr.git;a=commitdiff_plain;h=b599ec55f4b34607c529074d167284c6c06d246a *: silence '-Wmaybe-uninitialized' warnings on NetBSD None of these variables can actually be used before being initialized, but unfortunately some old compilers are not smart enough to detect that. Signed-off-by: Renato Westphal --- diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index de170fdd0..7f7d74625 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1743,7 +1743,7 @@ static int bgp_zebra_process_local_vni(int command, struct zclient *zclient, struct stream *s; vni_t vni; struct bgp *bgp; - struct in_addr vtep_ip; + struct in_addr vtep_ip = { INADDR_ANY }; vrf_id_t tenant_vrf_id = VRF_DEFAULT; s = zclient->ibuf; diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 37ca5edc9..15d27b396 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -494,7 +494,7 @@ void rfapiPrintBi(void *stream, struct bgp_info *bi) char *p = line; int r; int has_macaddr = 0; - struct ethaddr macaddr; + struct ethaddr macaddr = {{0}}; struct rfapi_l2address_option l2o_buf; uint8_t l2hid = 0; /* valid if has_macaddr */ diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 614f46c78..e1e9ccee4 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -286,7 +286,7 @@ static void put_lsp_hdr(struct isis_lsp *lsp, size_t *len_pointer, bool keep) (lsp->level == IS_LEVEL_1) ? L1_LINK_STATE : L2_LINK_STATE; struct isis_lsp_hdr *hdr = &lsp->hdr; struct stream *stream = lsp->pdu; - size_t orig_getp, orig_endp; + size_t orig_getp = 0, orig_endp = 0; if (keep) { orig_getp = stream_get_getp(lsp->pdu); diff --git a/lib/ptm_lib.c b/lib/ptm_lib.c index 28d26149e..dbfd2dc9f 100644 --- a/lib/ptm_lib.c +++ b/lib/ptm_lib.c @@ -347,7 +347,7 @@ int ptm_lib_process_msg(ptm_lib_handle_t *hdl, int fd, char *inbuf, int inlen, { int rc, len; char client_name[32]; - int cmd_id, type, ver, msglen; + int cmd_id = 0, type = 0, ver = 0, msglen = 0; csv_t *csv; ptm_lib_msg_ctxt_t *p_ctxt = NULL;