This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Cast size to long to warn
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Mon, 22 Dec 2014 15:30:55 -0800
- Subject: PATCH: Cast size to long to warn
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
On Linux/x32, I got
gcc -mx32 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow
-Werror -g -O2 -static-libstdc++ -static-libgcc -o cxxfilt cxxfilt.o
bucomm.o version.o filemode.o ../bfd/.libs/libbfd.a
../libiberty/libiberty.a -lz -ldl
/export/gnu/import/git/sources/binutils-gdb/binutils/dwarf.c: In
function âread_cieâ:
/export/gnu/import/git/sources/binutils-gdb/binutils/dwarf.c:5542:3:
error: format â%lxâ expects argument of type âlong unsigned intâ, but
argument 2 has type âintâ [-Werror=format=]
(augmentation_data + augmentation_data_len) - q);
^
I checkedin this patch to fix it.
H.J.
---
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index dc06202b..3158f5f 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * dwarf.c (read_cie): Cast size to long to warn.
+
2014-12-22 Nick Clifton <nickc@redhat.com>
PR binutils/17531
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 56f27ec..e4efd06 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5539,7 +5539,7 @@ read_cie (unsigned char *start, unsigned char *end,
if (q < qend)
{
warn (_("Not enough augmentation data (%lx bytes still needed)\n"),
- (augmentation_data + augmentation_data_len) - q);
+ (long) ((augmentation_data + augmentation_data_len) - q));
augmentation_data_len = q - augmentation_data;
}
}