[dpdk-dev] [dpdk-stable] [PATCH v6 2/2] lib/pipeline: Fix gcc compilation error using ASan
Peng, ZhihongX
zhihongx.peng at intel.com
Tue Oct 12 04:41:06 CEST 2021
> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Thursday, September 30, 2021 4:30 PM
> To: Peng, ZhihongX <zhihongx.peng at intel.com>
> Cc: Burakov, Anatoly <anatoly.burakov at intel.com>; Ananyev, Konstantin
> <konstantin.ananyev at intel.com>; Stephen Hemminger
> <stephen at networkplumber.org>; dev <dev at dpdk.org>; Lin, Xueqin
> <xueqin.lin at intel.com>; dpdk stable <stable at dpdk.org>
> Subject: Re: [dpdk-stable] [PATCH v6 2/2] lib/pipeline: Fix gcc compilation
> error using ASan
>
> On Thu, Sep 30, 2021 at 7:37 AM <zhihongx.peng at intel.com> wrote:
> >
> > From: Zhihong Peng <zhihongx.peng at intel.com>
>
> Commit titles don't start with lib/.
The v9 version will be fixed.
>
> >
> > After adding ASan, the gcc compilation check will be stricter.
> > "Control reaches end of non-void function" error occurs here.
>
> Fwiw, I could not pinpoint the right version where this warning appears.
> I can't see it with gcc v4.8.5 (rhel7), but I get it with gcc 11.2.1 (fc34).
> Do you know which versions are affected? Just asking for info.
>
>
> >
> > Fixes: f38913b7fb8e (pipeline: add meter array to SWX)
>
> Should be formatted as:
> Fixes: f38913b7fb8e ("pipeline: add meter array to SWX")
>
> Please use a git alias as suggested in the contribution guide.
The v9 version will be fixed.
>
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Xueqin Lin <xueqin.lin at intel.com>
> > Signed-off-by: Zhihong Peng <zhihongx.peng at intel.com>
> > ---
> > lib/pipeline/rte_swx_pipeline.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/pipeline/rte_swx_pipeline.c
> > b/lib/pipeline/rte_swx_pipeline.c index 1cd09a4b44..0acd6c6752 100644
> > --- a/lib/pipeline/rte_swx_pipeline.c
> > +++ b/lib/pipeline/rte_swx_pipeline.c
> > @@ -4642,7 +4642,7 @@ instr_meter_translate(struct rte_swx_pipeline *p,
> > return 0;
> > }
> >
> > - CHECK(0, EINVAL);
> > + return -EINVAL;
> > }
> >
> > static inline void
> > @@ -5937,7 +5937,7 @@ instr_translate(struct rte_swx_pipeline *p,
> > instr,
> > data);
> >
> > - CHECK(0, EINVAL);
> > + return -EINVAL;
> > }
> >
> > static struct instruction_data *
>
> There are two other functions (instr_table_translate, and
> instr_extern_translate) which have the same pattern in this file.
> Odd that the compiler is not reporting them.
The lowest version we tried is gcc version 7.4.0, the highest gcc version
9.3.0, these versions will report errors. As for why some do not report
errors, it may be gcc's own problem, we just let the compilation pass.
> --
> David Marchand
More information about the dev
mailing list