]> git.droids-corp.org - dpdk.git/commit
app/flow-perf: fix build with GCC 12
authorDavid Marchand <david.marchand@redhat.com>
Wed, 18 May 2022 10:16:56 +0000 (12:16 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 15 Jun 2022 08:21:19 +0000 (10:21 +0200)
commit5fc2eece8d4530988e5681fdc8a35e14d69b2a6f
tree26054a27da9f7bac7dc5734b21a1a722b04b3ed3
parent2a213b794fdd255fde7581a7c9bd034ab39e9b6a
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.

Bugzilla ID: 856
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
app/test-flow-perf/main.c