Hi,

> > > -----Original Message-----
> > > From: David Marchand <david.march...@redhat.com>
> > > Sent: Wednesday, May 18, 2022 1:17 PM
> > > To: dev@dpdk.org
> > > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL)
> <tho...@monjalon.net>;
> > > ferruh.yi...@xilinx.com; sta...@dpdk.org; Wisam Monther
> > > <wis...@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: sta...@dpdk.org
> > >
> > > Signed-off-by: David Marchand <david.march...@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?
> 
> Hum, I don't remember why I added this precision...
> This should be just a matter of changing the format from %'16.3s to %'16s,
> can you confirm?

Confirmed, you can go with it. Thanks in advance.

BRs,
Wisam Jaddo

Reply via email to