This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] mingw64 build.


Hi,
Even after your patch
https://sourceware.org/ml/binutils/2013-12/msg00225.html
Mingw64 build is still broken for me with
error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
This patch fixes it.

2013-12-27  Ilya Tocar  <ilya.tocar@intel.com>

	* peXXigen.c (rsrc_process_section): Use ptrdiff_t as the type for
	pointer arithmetic.

---
 bfd/peXXigen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index d50db73..1da5a9a 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -3541,7 +3541,7 @@ rsrc_process_section (bfd * abfd,
 	}
 
       /* Align the data pointer - we assume 1^2 alignment.  */
-      data = (bfd_byte *) (((long) (data + 3)) & ~ 3);
+      data = (bfd_byte *) (((ptrdiff_t) (data + 3)) & ~ 3);
       rva_bias += data - p;
 
       if (data == (dataend - 4))
@@ -3569,7 +3569,7 @@ rsrc_process_section (bfd * abfd,
 
       data = rsrc_parse_directory (abfd, type_tables + indx, data, data,
 				   dataend, rva_bias, NULL);
-      data = (bfd_byte *) (((long) (data + 3)) & ~ 3);
+      data = (bfd_byte *) (((ptrdiff_t) (data + 3)) & ~ 3);
       rva_bias += data - p;
       if (data == (dataend - 4))
 	data = dataend;
-- 
1.8.3.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]