public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Silence warning in verify_edges
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20191205152646.GA26168@delia> (raw)

Hi,

Since commit ad77fcd "Improve --devel-verify-edges" we're running into this
warning:
...
dwz.c: In function ‘verify_edges’:
dwz.c:6615:12: warning: ‘ipu’ may be used uninitialized in this function\
  [-Wmaybe-uninitialized]
   for (ipu = ipu->next; ipu; ipu = ipu->next)
        ~~~~^~~~~~~~~~~
...

Fix this by initializing ipu in verify_edges.

Committed to trunk.

Thanks,
- Tom

Silence warning in verify_edges

2019-12-05  Tom de Vries  <tdevries@suse.de>

	* dwz.c (verify_edges): Initialize ipu to NULL before the first loop,
	and assert it's no longer NULL after the first loop.

---
 dwz.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dwz.c b/dwz.c
index 6f88b82..6b45ad3 100644
--- a/dwz.c
+++ b/dwz.c
@@ -6547,6 +6547,7 @@ verify_edges (struct import_cu **ipus, unsigned int npus, unsigned int ncus)
   oc = 0;
 
   /* Verify initial PUs.  */
+  ipu = NULL;
   for (i = 0; i < npus; ++i)
     {
       ipu = ipus[i];
@@ -6556,6 +6557,7 @@ verify_edges (struct import_cu **ipus, unsigned int npus, unsigned int ncus)
     }
 
   /* Verify new PUs.  */
+  assert (ipu != NULL);
   for (ipu = ipu->next; ipu; ipu = ipu->next)
     verify_edges_1 (ipu, &ic, &oc);
 

                 reply	other threads:[~2019-12-05 15:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20191205152646.GA26168@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).