examples/pipeline: fix build

Message ID 20220602123412.3271817-1-alialnu@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series examples/pipeline: fix build |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Ali Alnubani June 2, 2022, 12:34 p.m. UTC
  This patch fixes the following build failure seen on Ubuntu 16.04
with gcc 5.4.0 because of uninitialized variable:
  [..]
  examples/pipeline/cli.c:2853:9: error: 'session_id' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]
  [..]

Fixes: 172254555f9f ("examples/pipeline: support packet mirroring")
Cc: cristian.dumitrescu@intel.com

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
---
 examples/pipeline/cli.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Cristian Dumitrescu June 7, 2022, 9:13 a.m. UTC | #1
> -----Original Message-----
> From: Ali Alnubani <alialnu@nvidia.com>
> Sent: Thursday, June 2, 2022 1:34 PM
> To: dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Subject: [PATCH] examples/pipeline: fix build
> 
> This patch fixes the following build failure seen on Ubuntu 16.04
> with gcc 5.4.0 because of uninitialized variable:
>   [..]
>   examples/pipeline/cli.c:2853:9: error: 'session_id' may be used
>     uninitialized in this function [-Werror=maybe-uninitialized]
>   [..]
> 
> Fixes: 172254555f9f ("examples/pipeline: support packet mirroring")
> Cc: cristian.dumitrescu@intel.com
> 
> Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
  
Thomas Monjalon June 7, 2022, 11:13 a.m. UTC | #2
> > This patch fixes the following build failure seen on Ubuntu 16.04
> > with gcc 5.4.0 because of uninitialized variable:
> >   [..]
> >   examples/pipeline/cli.c:2853:9: error: 'session_id' may be used
> >     uninitialized in this function [-Werror=maybe-uninitialized]
> >   [..]
> > 
> > Fixes: 172254555f9f ("examples/pipeline: support packet mirroring")
> > Cc: cristian.dumitrescu@intel.com
> > 
> > Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
> 
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks.
  

Patch

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 0334616bd9..ad553f19ab 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -2782,7 +2782,7 @@  cmd_pipeline_mirror_session(char **tokens,
 {
 	struct rte_swx_pipeline_mirroring_session_params params;
 	struct pipeline *p;
-	uint32_t session_id;
+	uint32_t session_id = 0;
 	int status;
 
 	if (n_tokens != 11) {