[dpdk-dev] [Bug 452] cuckoo hash gcc10 warning

bugzilla at dpdk.org bugzilla at dpdk.org
Fri Apr 17 21:04:06 CEST 2020


https://bugs.dpdk.org/show_bug.cgi?id=452

            Bug ID: 452
           Summary: cuckoo hash gcc10 warning
           Product: DPDK
           Version: 20.05
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: core
          Assignee: dev at dpdk.org
          Reporter: kevuzaj at gmail.com
  Target Milestone: ---

[1/83] Compiling C object
'lib/76b5a35@@rte_hash at sta/librte_hash_rte_cuckoo_hash.c.o'
../lib/librte_hash/rte_cuckoo_hash.c: In function
‘__rte_hash_add_key_with_hash’:
../lib/librte_hash/rte_cuckoo_hash.c:1104:29: warning: ‘ext_bkt_id’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
 1104 |  (h->buckets_ext[ext_bkt_id - 1]).sig_current[0] = short_sig;
      |                  ~~~~~~~~~~~^~~


Relevant code:
        if (rte_ring_sc_dequeue_elem(h->free_ext_bkts, &ext_bkt_id,
                                                sizeof(uint32_t)) != 0) {
                ret = -ENOSPC;
                goto failure;
        }

        /* Use the first location of the new bucket */
        (h->buckets_ext[ext_bkt_id - 1]).sig_current[0] = short_sig;

--
I'm not seeing the path that where rte_ring_sc_dequeue_elem() return !=0 and
ext_bkt_id has not been initialized but gcc10 seems to think there is one.
Initializing ext_bkt_id = 1 earlier in the function would fix this.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the dev mailing list