On 14/05/2020 12:17, Ferruh Yigit wrote: > On 5/14/2020 12:13 PM, Ferruh Yigit wrote: >> Minutes 14 May 2020 >> ------------------- > > <...> > >> * gcc10 >> * Akhil's fix for crypto looks good, can replace temporary solution >> * Gavin has patch for mbuf, but this stage can be late/risky for complex >> fix >> * At this stage we can go with disabling warning as temporary solution >> * Ferruh is getting a warning on hash too, will share it > > Hi David, > > Following is what I am getting [1] with compiler version: > gcc (GCC) 10.1.1 20200511 > > > [1] > .../dpdk/lib/librte_hash/rte_cuckoo_hash.c: In function > ‘__rte_hash_add_key_with_hash’: > .../dpdk/lib/librte_hash/rte_cuckoo_hash.c:1104:29: > error: ‘ext_bkt_id’ may be used uninitialized in this function > [-Werror=maybe-uninitialized] > 1104 | (h->buckets_ext[ext_bkt_id - 1]).sig_current[0] = short_sig; > | ~~~~~~~~~~~^~~ >
The return value of rte_ring_sc_dequeue_elem() is checked, but gcc seems to find some possibility of ext_bkt_id not being initialized. It was introduced with commit [1], but I guess the tools wouldn't have found it at time of commit. zero is an invalid value for ext_bkt_id, so we can just initialize to that and check it is overwritten. Sent patch https://patchwork.dpdk.org/patch/70333/ [1] commit fbfe568103b046a3c6c69c9ecd6c914b391c6b82 Author: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com> Date: Sat Jan 18 13:32:46 2020 -0600 hash: use 32-bit elements rings to save memory