DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ali Alnubani <alialnu@nvidia.com>
To: <dev@dpdk.org>
Cc: <cristian.dumitrescu@intel.com>
Subject: [PATCH] examples/pipeline: fix build with some compilers
Date: Sun, 25 Sep 2022 12:20:37 +0300	[thread overview]
Message-ID: <20220925092037.440076-1-alialnu@nvidia.com> (raw)

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


             reply	other threads:[~2022-09-25  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25  9:20 Ali Alnubani [this message]
2022-09-25 14:03 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220925092037.440076-1-alialnu@nvidia.com \
    --to=alialnu@nvidia.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).