```
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::unique_ptr<XskPacket>, std::allocator<std::unique_ptr<XskPacket> > >&)’ 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];
| ~~~~^~~~~~~~~~
```
if (packetSize == 0) {
return;
}
- uint32_t idx;
+ uint32_t idx{0};
if (xsk_ring_prod__reserve(&tx, packetSize, &idx) != packets.size()) {
return;
}