[DPDK/core Bug 2135] eal: unreachable code warning

bugzilla at dpdk.org bugzilla at dpdk.org
Tue Nov 17 18:07:54 CET 2026


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

            Bug ID: 2135
           Summary: eal: unreachable code warning
           Product: DPDK
           Version: 26.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: Low
         Component: core
          Assignee: dev at dpdk.org
          Reporter: stephen at networkplumber.org
  Target Milestone: ---

Building with clang and -Wunreachable-code finds this:

[18/3982] Compiling C object lib/librte_eal.a.p/eal_common_rte_version.c.o
../lib/eal/common/rte_version.c:40:3: warning: code will never be executed
[-Wunreachable-code]
   40 |                 snprintf(version, sizeof(version), "%s %d.%02d.%d",
      |                 ^~~~~~~~
../lib/eal/common/rte_version.c:39:32: note: silence by adding parentheses to
mark code as explicitly dead
   39 |         if (strlen(RTE_VER_SUFFIX) == 0)
      |                                       ^
      |                                       /* DISABLES CODE */ ( )
1 warning generated.

It can be fixed by adding parens, using sizeof, or useing RTE_VERSION which is
already built by meson.

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


More information about the dev mailing list