On Sun, Nov 29, 2026 at 04:26:49PM -0800, Stephen Hemminger wrote: > rte_version() used "strlen(RTE_VER_SUFFIX) == 0" to detect an empty > suffix. Clang evaluates strlen of a constant string at compile time > and then reports the other branch as unreachable code. > > Use sizeof instead, which clang treats as a configuration value and > does not warn about. Note that sizeof of a string literal includes > the NUL terminator, so the empty string is sizeof 1 rather than 0. > > Also fix the indentation of the else. > > Bugzilla ID: 2135 > > Signed-off-by: Stephen Hemminger <[email protected]> > --- > lib/eal/common/rte_version.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > Acked-by: Bruce Richardson <[email protected]>
- [PATCH 00/37] enable unreachable code detection Stephen Hemminger
- [PATCH 04/37] eal: silence unreachable code in vers... Stephen Hemminger
- Re: [PATCH 04/37] eal: silence unreachable code... Bruce Richardson
- [PATCH 05/37] net/dpaa2: remove debug abort in flow... Stephen Hemminger
- [PATCH 06/37] app/testpmd: fix unreachable VF traff... Stephen Hemminger
- [PATCH 07/37] examples/eventdev_pipeline: remove de... Stephen Hemminger
- [PATCH 08/37] examples/ipsec-secgw: remove unreacha... Stephen Hemminger
- Re: [PATCH 08/37] examples/ipsec-secgw: remove ... Radu Nicolau
- [PATCH 09/37] examples/skeleton: handle SIGINT and ... Stephen Hemminger
- [PATCH 10/37] examples/rxtx_callbacks: handle SIGIN... Stephen Hemminger
- [PATCH 13/37] examples/multi_process: handle SIGINT... Stephen Hemminger
- [PATCH 14/37] examples/server_node_efd: handle SIGI... Stephen Hemminger
- [PATCH 11/37] examples/service_cores: handle SIGINT... Stephen Hemminger

