From 50e2d39a524a2e166e1f779b8dae7473a52be26e Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 22 Jun 2012 16:44:54 +0200 Subject: [PATCH] readelf.c: Cast printf PRIu/x64 arguments to uint64_t for gcc 4.7 -Wformat. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 +++++ src/readelf.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index af1d92bd7..40905b8a3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-06-22 Mark Wielaard + + * readelf.c (print_ops): Cast printf PRIu/x64 arguments to uint64_t + for gcc 4.7 -Wformat. + 2012-05-09 Roland McGrath * elflint (check_sections): Allow zero sized sections at (filesz) end diff --git a/src/readelf.c b/src/readelf.c index 5dc9b6fe6..d182ab50b 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -4167,7 +4167,7 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest, // XXX value might be modified by relocation printf ("%*s[%4" PRIuMAX "] %s %" PRIu64 "\n", indent, "", (uintmax_t) offset, - known[op], read_8ubyte_unaligned (dbg, data)); + known[op], (uint64_t) read_8ubyte_unaligned (dbg, data)); CONSUME (8); data += 8; offset += 9; @@ -5606,7 +5606,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) printf (" %*s%-20s (%s) {%6" PRIx64 "}\n", (int) (level * 2), "", dwarf_attr_string (attr), dwarf_form_string (form), - read_8ubyte_unaligned (attrp->cu->dbg, attrp->valp)); + (uint64_t) read_8ubyte_unaligned (attrp->cu->dbg, attrp->valp)); break; case DW_FORM_sec_offset: -- 2.47.2