> -----Original Message-----
> From: Ferruh Yigit <[email protected]>
> Sent: Monday, July 22, 2024 1:52 PM
> To: Aman Singh <[email protected]>; Sivaprasad Tummala
> <[email protected]>
> Cc: [email protected]; [email protected]; Raslan Darawsheh <[email protected]>
> Subject: [PATCH] app/testpmd: fix build on signed comparison
> 
> Build error:
> .../app/test-pmd/config.c: In function 'icmp_echo_config_setup':
> .../app/test-pmd/config.c:5159:30:
>    error: comparison between signed and unsigned integer expressions
>           [-Werror=sign-compare]
>   if ((nb_txq * nb_fwd_ports) < nb_fwd_lcores)
>                               ^
> All 'nb_txq', 'nb_fwd_ports' & 'nb_fwd_lcores' are unsigned variables,
> but the warning is related to the integer promotion rules of C:
> 'nb_txq'       -> uint16_t, promoted to 'int'
> 'nb_fwd_ports' -> uint16_t, promoted to 'int'
> (nb_txq * nb_fwd_ports) -> result 'int'
> nb_fwd_lcores  -> 'uint32_t'
> Ends up comparing 'int' vs 'uint32_t'.
> 
> Fixing by adding the casting back which was initially part of the patch.
> 
> Fixes: 2bf44dd14fa5 ("app/testpmd: fix lcore ID restriction")
> Cc: [email protected]
> 
> Reported-by: Raslan Darawsheh <[email protected]>
> Signed-off-by: Ferruh Yigit <[email protected]>
> ---
> Cc: [email protected]
> ---

Hi Ferruh,

I tested on openSUSE Leap 15.6 (gcc 7.5.0) with debug build type and can 
confirm it resolves the build failure.

Tested-by: Ali Alnubani <[email protected]>

Thanks,
Ali

Reply via email to