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]

Re: [gold] Build regression on i386 host [Re: [patch 6/7] [gold] Add initial source code for dwp utility.]


On Thu, Oct 25, 2012 at 09:10:14AM +0200, Jan Kratochvil wrote:
> > +  if (p == this->str_offset_map_.end() || p->first > val)
> 
> dwp.cc:1334:54: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

On 32-bit hosts, p->first, a section_offset_type, is 32-bit signed.  I
think we are only interested in non-negative offsets, so maybe this:

Index: gold/dwp.cc
===================================================================
RCS file: /cvs/src/src/gold/dwp.cc,v
retrieving revision 1.1
diff -u -p -r1.1 dwp.cc
--- gold/dwp.cc	24 Oct 2012 02:26:39 -0000	1.1
+++ gold/dwp.cc	25 Oct 2012 11:02:00 -0000
@@ -74,7 +74,7 @@ class Dwo_file
 
  private:
   // Types for mapping input string offsets to output string offsets.
-  typedef std::pair<section_offset_type, section_offset_type>
+  typedef std::pair<section_size_type, section_size_type>
       Str_offset_map_entry;
   typedef std::vector<Str_offset_map_entry> Str_offset_map;
 

-- 
Alan Modra
Australia Development Lab, IBM


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