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]>

Reply via email to