[v1] examples/ip_pipeline: fix build issue with GCC 13
Checks
Commit Message
From: Jerin Jacob <jerinj@marvell.com>
Fix the following build issue by initializing req to NULL for
the local variable.
In function 'thread_msg_handle', inlined from 'thread_main' at
../examples/ip_pipeline/thread.c:3130:6:
../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
uninitialized [-Wmaybe-uninitialized]
535 | if (req == NULL)
| ^
../examples/ip_pipeline/thread.c: In function 'thread_main':
../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
433 | struct thread_msg_req *req;
Bugzilla ID: 1220
Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
examples/ip_pipeline/thread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: Tuesday, May 2, 2023 2:51 PM
> To: dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>;
> Singh, Jasvinder <jasvinder.singh@intel.com>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> ferruh.yigit@xilinx.com; stephen@networkplumber.org; Jerin Jacob
> <jerinj@marvell.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> Fix the following build issue by initializing req to NULL for
> the local variable.
>
> In function 'thread_msg_handle', inlined from 'thread_main' at
> ../examples/ip_pipeline/thread.c:3130:6:
> ../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
> uninitialized [-Wmaybe-uninitialized]
> 535 | if (req == NULL)
> | ^
> ../examples/ip_pipeline/thread.c: In function 'thread_main':
> ../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
> 433 | struct thread_msg_req *req;
>
> Bugzilla ID: 1220
> Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: 2023年5月2日 21:51
> To: dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>;
> Singh, Jasvinder <jasvinder.singh@intel.com>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> ferruh.yigit@xilinx.com; stephen@networkplumber.org; Jerin Jacob
> <jerinj@marvell.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> Fix the following build issue by initializing req to NULL for the local variable.
>
> In function 'thread_msg_handle', inlined from 'thread_main' at
> ../examples/ip_pipeline/thread.c:3130:6:
> ../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
> uninitialized [-Wmaybe-uninitialized]
> 535 | if (req == NULL)
> | ^
> ../examples/ip_pipeline/thread.c: In function 'thread_main':
> ../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
> 433 | struct thread_msg_req *req;
>
> Bugzilla ID: 1220
> Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
On Tue, May 2, 2023 at 3:51 PM <jerinj@marvell.com> wrote:
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> Fix the following build issue by initializing req to NULL for
> the local variable.
>
> In function 'thread_msg_handle', inlined from 'thread_main' at
> ../examples/ip_pipeline/thread.c:3130:6:
> ../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
> uninitialized [-Wmaybe-uninitialized]
> 535 | if (req == NULL)
> | ^
> ../examples/ip_pipeline/thread.c: In function 'thread_main':
> ../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
> 433 | struct thread_msg_req *req;
>
> Bugzilla ID: 1220
> Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
Applied, thanks.
@@ -430,7 +430,7 @@ thread_pipeline_disable(uint32_t thread_id,
static inline struct thread_msg_req *
thread_msg_recv(struct rte_ring *msgq_req)
{
- struct thread_msg_req *req;
+ struct thread_msg_req *req = NULL;
int status = rte_ring_sc_dequeue(msgq_req, (void **) &req);