Thread (117 messages) 117 messages, 11 authors, 2021-11-03

Re: [dpdk-dev] [dpdk-stable] [PATCH v6 2/2] lib/pipeline: Fix gcc compilation error using ASan

From: David Marchand <hidden>
Date: 2021-09-30 08:29:52

On Thu, Sep 30, 2021 at 7:37 AM [off-list ref] wrote:
From: Zhihong Peng <redacted>
Commit titles don't start with lib/.

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.

quoted hunk ↗ jump to hunk
Cc: stable@dpdk.org

Signed-off-by: Xueqin Lin <redacted>
Signed-off-by: Zhihong Peng <redacted>
---
 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.

-- 
David Marchand
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help