[PATCH 0/2] fix minsize build errors with GCC

Jack Bond-Preston jack.bond-preston at foss.arm.com
Thu Oct 15 14:57:38 CEST 2026


When building DPDK with a "minsize" build, GCC is throwing the following
maybe-uninitialized warnings (errors with Werror):
In file included from ../lib/eal/include/rte_bitops.h:24,
                 from ../lib/eal/include/rte_memory.h:18,
                 from ../lib/eal/include/rte_memzone.h:26,
                 from ../lib/gpudev/gpudev.c:12:
../lib/gpudev/gpudev.c: In function 'rte_gpu_attach':
../lib/gpudev/gpudev.c:290:39: warning: 'shared_dev' may be used uninitialized [-Wmaybe-uninitialized]
  290 |         rte_atomic_fetch_add_explicit(&dev->mpshared->process_refcnt, 1, rte_memory_order_relaxed);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/eal/include/rte_stdatomic.h:230:28: note: in definition of macro 'rte_atomic_fetch_add_explicit'
  230 |         __atomic_fetch_add(ptr, val, memorder)
      |                            ^~~
../lib/gpudev/gpudev.c:254:34: note: 'shared_dev' was declared here
  254 |         struct rte_gpu_mpshared *shared_dev;
      |                                  ^~~~~~~~~~
../drivers/net/bonding/rte_eth_bond_pmd.c: In function 'bond_ethdev_tx_burst_tlb':
../drivers/net/bonding/rte_eth_bond_pmd.c:997:29: warning: 'primary_member_addr' may be used uninitialized [-Wmaybe-uninitialized]
  997 |                         if (rte_is_same_ether_addr(&ether_hdr->src_addr,
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  998 |                                                         &primary_member_addr))
      |                                                         ~~~~~~~~~~~~~~~~~~~~~
In file included from ../lib/ethdev/rte_eth_ctrl.h:10,
                 from ../lib/ethdev/rte_ethdev.h:1483,
                 from ../lib/ethdev/ethdev_driver.h:21,
                 from ../drivers/net/bonding/rte_eth_bond_pmd.c:11:
../lib/net/rte_ether.h:102:19: note: by argument 2 of type 'const struct rte_ether_addr *' to 'rte_is_same_ether_addr' declared here
  102 | static inline int rte_is_same_ether_addr(const struct rte_ether_addr *ea1,
      |                   ^~~~~~~~~~~~~~~~~~~~~~
../drivers/net/bonding/rte_eth_bond_pmd.c:972:31: note: 'primary_member_addr' declared here
  972 |         struct rte_ether_addr primary_member_addr;
      |

I can reproduce this in GCC 13.3.0, 14.2.0, 15.2.0 and 16.0.1 - for minsize
builds only.

Neither of these indicate real bugs in the code - this patch series aims to
satisfy the compiler with minimal impact of the codebase.

Jack Bond-Preston (2):
  gpudev: fix minsize build
  net/bonding: fix minsize build

 drivers/net/bonding/rte_eth_bond_pmd.c | 9 +++++++--
 lib/gpudev/gpudev.c                    | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

--
2.43.0



More information about the dev mailing list