* [committed] Silence warning in verify_edges
@ 2019-01-01 0:00 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01 0:00 UTC (permalink / raw)
To: dwz, jakub
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-05 15:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01 0:00 [committed] Silence warning in verify_edges Tom de Vries
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).