misc: silence -Wmaybe-uninitialized warnings 07/39807/2
authorJieqiang Wang <jieqiang.wang@arm.com>
Mon, 24 Jul 2023 08:52:06 +0000 (16:52 +0800)
committerDamjan Marion <dmarion@0xa5.net>
Tue, 7 Nov 2023 10:58:50 +0000 (10:58 +0000)
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

src/vcl/ldp.c
src/vlib/buffer_funcs.c
src/vnet/policer/police_inlines.h
src/vnet/tcp/tcp_output.c

index 79e7cf3..0338ce6 100644 (file)
@@ -1894,7 +1894,7 @@ recvmsg (int fd, struct msghdr * msg, int flags)
     {
       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)
index f0e2add..d910b25 100644 (file)
@@ -16,7 +16,7 @@ enqueue_one (vlib_main_t *vm, vlib_node_runtime_t *node,
   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);
 
index 6b0c0ec..08000b9 100644 (file)
@@ -123,7 +123,7 @@ policer_handoff (vlib_main_t *vm, vlib_node_runtime_t *node,
   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;
index c8e80d0..aad69df 100644 (file)
@@ -420,7 +420,7 @@ static inline void
 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;