From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48359 invoked by alias); 28 Nov 2019 10:39:35 -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 48350 invoked by uid 89); 28 Nov 2019 10:39:35 -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= 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] Fix Wformat warnings in write_die with CC="gcc -m32" Message-ID: <20191128103927.GA11594@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q4/txt/msg00091.txt.bz2 Hi, Using: ... $ make CC="gcc -m32" ... we run into this warning: ... gcc -m32 -O2 -g -Wall -W -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"0.13"' \ -DFSF_YEARS='"1992-2019"' -DRH_YEARS='"2001-2018"' -DSUSE_YEARS='"2019"' \ -c -o dwz.o /data/dwz/dwz.git/dwz.c dwz.c: In function 'write_die': dwz.c:9463:55: warning: format '%lx' expects argument of type \ 'long unsigned int', but argument 4 has type \ 'uint64_t {aka long long unsigned int}' [-Wformat=] "Couldn't find DIE at DW_FORM_ref_addr offset 0x%lx", ~~^ %llx ... Fix this by using PRIx64 to print the uint64_t value. Committed to trunk. Thanks, - Tom Fix Wformat warnings in write_die with CC="gcc -m32" 2019-11-28 Tom de Vries * dwz.c: Include inttypes.h to provide PRIx64. (write_die): Use PRIx64 to fix Wformat warning. --- dwz.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dwz.c b/dwz.c index 5cf05f8..93fc9de 100644 --- a/dwz.c +++ b/dwz.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -9459,9 +9460,8 @@ write_die (unsigned char *ptr, dw_cu_ref cu, dw_die_ref die, inptr += refcu->cu_version == 2 ? ptr_size : 4; refd = off_htab_lookup (NULL, value); if (refd == NULL || refd->die_tag == 0) - error (1, 0, - "Couldn't find DIE at DW_FORM_ref_addr offset 0x%lx", - value); + error (1, 0, "Couldn't find DIE at DW_FORM_ref_addr offset" + " 0x%" PRIx64, value); assert (refd != NULL); refdt = refd; while (refdt->die_toplevel == 0)