From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116988 invoked by alias); 4 Jul 2019 09:36:27 -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 116977 invoked by uid 89); 4 Jul 2019 09:36:27 -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=-26.3 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=HContent-Transfer-Encoding:8bit X-Spam-Status: No, score=-26.3 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 with make CC="gcc -m32" Message-ID: <20190704093617.GA4741@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-q3/txt/msg00026.txt.bz2 Hi, We see this warning (and similar) with make CC="gcc -m32": ... dwz.c: In function ‘calculate_section_distance’: dwz.c:10517:47: warning: format ‘%lx’ expects argument of \ type ‘long unsigned int’, but argument 4 has \ type ‘GElf_Off {aka long long unsigned int}’ [-Wformat=] error (0, 0, "Section header table: [0x%lx, 0x%ld)", prev_offset, ... Fix this by using %llx and casting the argument to unsigned long long. Committed to trunk. Thanks, - Tom Fix Wformat warnings with make CC="gcc -m32" 2019-07-04 Tom de Vries PR dwz/24765 * dwz.c (calculate_section_distance): Fix Wformat warnings. --- dwz.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dwz.c b/dwz.c index 19e8f10..f854c66 100644 --- a/dwz.c +++ b/dwz.c @@ -10514,15 +10514,18 @@ calculate_section_distance (DSO *dso, unsigned int *sorted_section_numbers, { error (0, 0, "Section overlap detected"); if (prev == dso->ehdr.e_shnum) - error (0, 0, "Section header table: [0x%lx, 0x%ld)", prev_offset, - prev_offset + prev_size); + error (0, 0, "Section header table: [0x%llx, 0x%lld)", + (unsigned long long)prev_offset, + (unsigned long long)(prev_offset + prev_size)); else - error (0, 0, "Section %d: [0x%lx, 0x%ld)", j, prev_offset, - prev_offset + prev_size); + error (0, 0, "Section %d: [0x%llx, 0x%lld)", j, + (unsigned long long)prev_offset, + (unsigned long long)(prev_offset + prev_size)); if (j == dso->ehdr.e_shnum) - error (0, 0, "Section header table: 0x%lx", offset); + error (0, 0, "Section header table: 0x%llx", + (unsigned long long)offset); else - error (0, 0, "Section %d: 0x%lx", j, offset); + error (0, 0, "Section %d: 0x%llx", j, (unsigned long long)offset); return 1; }