[PATCH] app/testpmd: fix build on signed comparison
Ferruh Yigit
ferruh.yigit at amd.com
Mon Jul 22 15:26:48 CEST 2024
On 7/22/2024 11:52 AM, Ferruh Yigit wrote:
> 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: stable at dpdk.org
>
> Reported-by: Raslan Darawsheh <rasland at nvidia.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit at amd.com>
>
Hi Raslan, Ali,
If you can test the patch, as I can't reproduce the build error, I can
quickly merge the fix for -rc3.
Thanks,
ferruh
More information about the dev
mailing list