DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] examples/pipeline: fix build with some compilers
@ 2022-09-25  9:20 Ali Alnubani
  2022-09-25 14:03 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Ali Alnubani @ 2022-09-25  9:20 UTC (permalink / raw)
  To: dev; +Cc: cristian.dumitrescu

Fixes the following build failure with gcc 5.4.0 because
of uninitialized variables:

[..]
examples/pipeline/cli.c:1801:10: error: 'idx' may be used
  uninitialized in this function [-Werror=maybe-uninitialized]
[..]
examples/pipeline/cli.c:1916:10: error: 'idx' may be used
  uninitialized in this function [-Werror=maybe-uninitialized]
[..]

Fixes: 83f58a7b7b0a ("examples/pipeline: add commands for direct registers")
Cc: cristian.dumitrescu@intel.com

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

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 35beb1139f..8013541c4b 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -1786,7 +1786,7 @@ cmd_pipeline_regrd(char **tokens,
 
 	/* index. */
 	if (!strcmp(tokens[4], "index")) {
-		uint32_t idx;
+		uint32_t idx = 0;
 
 		if (n_tokens != 6) {
 			snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
@@ -1901,7 +1901,7 @@ cmd_pipeline_regwr(char **tokens,
 
 	/* index. */
 	if (!strcmp(tokens[6], "index")) {
-		uint32_t idx;
+		uint32_t idx = 0;
 
 		if (n_tokens != 8) {
 			snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] examples/pipeline: fix build with some compilers
  2022-09-25  9:20 [PATCH] examples/pipeline: fix build with some compilers Ali Alnubani
@ 2022-09-25 14:03 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2022-09-25 14:03 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: dev, cristian.dumitrescu

25/09/2022 11:20, Ali Alnubani:
> Fixes the following build failure with gcc 5.4.0 because
> of uninitialized variables:
> 
> [..]
> examples/pipeline/cli.c:1801:10: error: 'idx' may be used
>   uninitialized in this function [-Werror=maybe-uninitialized]
> [..]
> examples/pipeline/cli.c:1916:10: error: 'idx' may be used
>   uninitialized in this function [-Werror=maybe-uninitialized]
> [..]
> 
> Fixes: 83f58a7b7b0a ("examples/pipeline: add commands for direct registers")
> Cc: cristian.dumitrescu@intel.com
> 
> Signed-off-by: Ali Alnubani <alialnu@nvidia.com>

Applied, thanks.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-25 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25  9:20 [PATCH] examples/pipeline: fix build with some compilers Ali Alnubani
2022-09-25 14:03 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).