* [committed] Fix Wformat warnings with make CC="gcc -m32"
@ 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,
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 <tdevries@suse.de>
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-04 9:36 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] Fix Wformat warnings with make CC="gcc -m32" 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).