This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: Broken cast in linux-thread-db


On Wed, Oct 12, 2005 at 04:13:11PM +0200, Andreas Schwab wrote:
> Casting a pointer to CORE_ADDR results in implementation defined behaviour
> when the latter is wider than a pointer.  The implementation's behaviour
> might be to sign extend which is not what we want here.  Tested on
> i386-suse-linux with --enable-64-bit-bfd.

This will silence the warning, but AFAICS not fix anything.  Now you're
casting it to something explicitly unsigned, but the same size as a
pointer; but GDB tries to use the target's sign extension conventions,
and a CORE_ADDR ought to be properly sign extended on MIPS.

I think the current behavior is actually more correct despite any
warning.  Were you fixing an observed problem?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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