From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46140 invoked by alias); 5 Dec 2019 15:26:53 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 46100 invoked by uid 89); 5 Dec 2019 15:26:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1179, HContent-Transfer-Encoding:8bit X-Spam-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx1.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed] Silence warning in verify_edges Message-ID: <20191205152646.GA26168@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q4/txt/msg00115.txt.bz2 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 * 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);