misc: silence -Wmaybe-uninitialized warnings
GCC 12 complains about such errors while the code itself looks good.
Type: fix
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I021719fdbf7d9bd93a12eac76aeac8cbca13a810
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c
index 79e7cf3..0338ce6 100644
--- a/src/vcl/ldp.c
+++ b/src/vcl/ldp.c
@@ -1894,7 +1894,7 @@
{
struct iovec *iov = msg->msg_iov;
ssize_t max_deq, total = 0;
- int i, rv;
+ int i, rv = 0;
max_deq = vls_attr (vlsh, VPPCOM_ATTR_GET_NREAD, 0, 0);
if (!max_deq)
diff --git a/src/vlib/buffer_funcs.c b/src/vlib/buffer_funcs.c
index f0e2add..d910b25 100644
--- a/src/vlib/buffer_funcs.c
+++ b/src/vlib/buffer_funcs.c
@@ -16,7 +16,7 @@
vlib_frame_bitmap_t match_bmp;
vlib_frame_t *f;
u32 n_extracted, n_free;
- u32 *to, *to_aux;
+ u32 *to, *to_aux = 0;
f = vlib_get_next_frame_internal (vm, node, next_index, 0);
diff --git a/src/vnet/policer/police_inlines.h b/src/vnet/policer/police_inlines.h
index 6b0c0ec..08000b9 100644
--- a/src/vnet/policer/police_inlines.h
+++ b/src/vnet/policer/police_inlines.h
@@ -123,7 +123,7 @@
u32 n_enq, n_left_from, *from;
vnet_policer_main_t *pm;
policer_t *policer;
- u32 this_thread, policer_thread;
+ u32 this_thread, policer_thread = 0;
bool single_policer_node = (policer_index != ~0);
pm = &vnet_policer_main;
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index c8e80d0..aad69df 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -420,7 +420,7 @@
tcp_make_ack_i (tcp_connection_t * tc, vlib_buffer_t * b, tcp_state_t state,
u8 flags)
{
- tcp_options_t _snd_opts, *snd_opts = &_snd_opts;
+ tcp_options_t _snd_opts = {}, *snd_opts = &_snd_opts;
u8 tcp_opts_len, tcp_hdr_opts_len;
tcp_header_t *th;
u16 wnd;