From d7a4f1fd253facecdd529d255fec713da2bd3bd3 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 1 Mar 2023 11:34:02 +0100 Subject: [PATCH] dnsdist: Prevent a false-positive warning from the compiler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ``` In file included from xsk.hh:50, from xsk.cc:23: In function ‘xdp_desc* xsk_ring_prod__tx_desc(xsk_ring_prod*, __u32)’, inlined from ‘void XskSocket::send(std::vector, std::allocator > >&)’ at xsk.cc:176:28: /usr/include/xdp/xsk.h:76:27: warning: ‘idx’ may be used uninitialized [-Wmaybe-uninitialized] 76 | return &descs[idx & tx->mask]; | ~~~~^~~~~~~~~~ ``` --- pdns/xsk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/xsk.cc b/pdns/xsk.cc index f43d4a3c85..778d3cf4ae 100644 --- a/pdns/xsk.cc +++ b/pdns/xsk.cc @@ -167,7 +167,7 @@ void XskSocket::send(std::vector& packets) if (packetSize == 0) { return; } - uint32_t idx; + uint32_t idx{0}; if (xsk_ring_prod__reserve(&tx, packetSize, &idx) != packets.size()) { return; } -- 2.47.2