* [Patch] Fix build problem found by build robot
@ 2014-12-02 18:31 Steve Ellcey
2014-12-05 6:37 ` Alan Modra
0 siblings, 1 reply; 2+ messages in thread
From: Steve Ellcey @ 2014-12-02 18:31 UTC (permalink / raw)
To: binutils
As reported by the build robot in
https://sourceware.org/ml/binutils/2014-11/msg00376.html
some binutils builds are failing, I see it when compiling binutils in 32 bit
mode on an x86 box targeting MIPS. Compiling the toolchain in 64 bit mode
does not trigger the failure.
The failure is:
cc1: warnings being treated as errors
/scratch/gcc/nightly/src/binutils-gdb/bfd/ecoff.c: In function '_bfd_ecoff_slurp_symbol_table':
/scratch/gcc/nightly/src/binutils-gdb/bfd/ecoff.c:955: warning: comparison between signed and unsigned
Here is my proposed fix for the problem. I cast bfd_get_symcount (which is
unsigned int, the type of symcount in the bfd structure) to ptrdiff_t before
comparing it to 'internal_ptr - internal'. Both of those variables are
pointers.
OK for checkin?
Steve Ellcey
sellcey@imgtec.com
2014-12-02 Steve Ellcey <sellcey@mips.com>
* ecoff.c (_bfd_ecoff_slurp_symbol_table): Add cast.
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 70783b1..e72e254 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -952,7 +952,7 @@ _bfd_ecoff_slurp_symbol_table (bfd *abfd)
and ecoff_data (abfd)->debug_info.symbolic_header.ifdMax can mean that
we have fewer symbols than we were expecting. Allow for this by updating
the symbol count and warning the user. */
- if (internal_ptr - internal < bfd_get_symcount (abfd))
+ if (internal_ptr - internal < (ptrdiff_t) bfd_get_symcount (abfd))
{
bfd_get_symcount (abfd) = internal_ptr - internal;
(*_bfd_error_handler)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch] Fix build problem found by build robot
2014-12-02 18:31 [Patch] Fix build problem found by build robot Steve Ellcey
@ 2014-12-05 6:37 ` Alan Modra
0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2014-12-05 6:37 UTC (permalink / raw)
To: Steve Ellcey; +Cc: binutils
On Tue, Dec 02, 2014 at 10:31:45AM -0800, Steve Ellcey wrote:
> * ecoff.c (_bfd_ecoff_slurp_symbol_table): Add cast.
OK.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-05 6:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-02 18:31 [Patch] Fix build problem found by build robot Steve Ellcey
2014-12-05 6:37 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).