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

Bruce Richardson bruce.richardson at intel.com
Thu Jun 2 12:21:05 CEST 2022


On Wed, May 18, 2022 at 12:16:56PM +0200, David Marchand wrote:
> 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>

Good idea.

Acked-by: Bruce Richardson <bruce.richardson at intel.com>


More information about the stable mailing list