Broken cast in linux-thread-db

Daniel Jacobowitz drow@false.org
Wed Oct 12 14:24:00 GMT 2005


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



More information about the Gdb-patches mailing list