[PATCH 11/12] app/flow-perf: fix build with GCC 12

Wisam Monther wisamm at nvidia.com
Wed Jun 8 11:03:43 CEST 2022


Hi David,

> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Wednesday, May 18, 2022 1:17 PM
> To: dev at dpdk.org
> Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas at monjalon.net>;
> ferruh.yigit at xilinx.com; stable at dpdk.org; Wisam Monther
> <wisamm at nvidia.com>
> Subject: [PATCH 11/12] app/flow-perf: fix build with GCC 12
> 
> GCC 12 raises the following warning:
> 
> ../app/test-flow-perf/main.c: In function ‘start_forwarding’:
> ../app/test-flow-perf/main.c:1737:28: error: ‘sprintf’ may write a
>     terminating nul past the end of the destination
>     [-Werror=format-overflow=]
>  1737 |         sprintf(p[i++], "%d", (int)n);
>       |                            ^
> In function ‘pretty_number’,
>     inlined from ‘packet_per_second_stats’ at
>         ../app/test-flow-perf/main.c:1792:4,
>     inlined from ‘start_forwarding’ at
>         ../app/test-flow-perf/main.c:1831:3:
> [...]
> 
> We can simplify this code and rely on libc integer formatting via this system
> locales.
> 
> Cc: stable at dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---

I've tested the patch and reviewed it, it's working fine, so thank you for that.
One comment
The initial value of 0 is 000

Example:
CMD: ./dpdk-test-flow-perf -n 4 -a <PCI> -- ingress --group=1 --ether --queue --rules-count=200000 --enable-fwd
  core               tx         tx drops               rx
------ ---------------- ---------------- ----------------
     1              000              000              000

Can you handle this to be single 0 instead of not needed leading zeros? 

BRs,
Wisam Jaddo


More information about the stable mailing list