This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold patch committed] Fix 32-bit build
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Wed, 18 Aug 2010 17:02:20 -0700
- Subject: [gold patch committed] Fix 32-bit build
There are some warnings in gold about signed/unsigned comparisons when
building on a host for which ptrdiff_t is the same size as unsigned int.
Fixed with this patch. Committed to mainline.
Ian
2010-08-18 Ian Lance Taylor <iant@google.com>
* incremental.cc
(Output_section_incremental_inputs::write_input_files): Add cast
to avoid signed/unsigned comparison warning.
(Output_section_incremental_inputs::write_info_blocks): Likewise.
Index: incremental.cc
===================================================================
RCS file: /cvs/src/src/gold/incremental.cc,v
retrieving revision 1.20
diff -p -u -r1.20 incremental.cc
--- incremental.cc 12 Aug 2010 22:14:59 -0000 1.20
+++ incremental.cc 18 Aug 2010 23:58:55 -0000
@@ -784,7 +784,7 @@ Output_section_incremental_inputs<size,
p != inputs->input_files().end();
++p)
{
- gold_assert(pov - oview == (*p)->get_offset());
+ gold_assert(static_cast<unsigned int>(pov - oview) == (*p)->get_offset());
section_offset_type filename_offset =
strtab->get_offset_from_key((*p)->get_filename_key());
const Timespec& mtime = (*p)->get_mtime();
@@ -827,7 +827,8 @@ Output_section_incremental_inputs<size,
case INCREMENTAL_INPUT_OBJECT:
case INCREMENTAL_INPUT_ARCHIVE_MEMBER:
{
- gold_assert(pov - oview == (*p)->get_info_offset());
+ gold_assert(static_cast<unsigned int>(pov - oview)
+ == (*p)->get_info_offset());
Incremental_object_entry* entry = (*p)->object_entry();
gold_assert(entry != NULL);
const Object* obj = entry->object();
@@ -897,7 +898,8 @@ Output_section_incremental_inputs<size,
case INCREMENTAL_INPUT_SHARED_LIBRARY:
{
- gold_assert(pov - oview == (*p)->get_info_offset());
+ gold_assert(static_cast<unsigned int>(pov - oview)
+ == (*p)->get_info_offset());
Incremental_object_entry* entry = (*p)->object_entry();
gold_assert(entry != NULL);
const Object* obj = entry->object();
@@ -920,7 +922,8 @@ Output_section_incremental_inputs<size,
case INCREMENTAL_INPUT_ARCHIVE:
{
- gold_assert(pov - oview == (*p)->get_info_offset());
+ gold_assert(static_cast<unsigned int>(pov - oview)
+ == (*p)->get_info_offset());
Incremental_archive_entry* entry = (*p)->archive_entry();
gold_assert(entry != NULL);