This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Broken cast in linux-thread-db
- From: Daniel Jacobowitz <drow at false dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 12 Oct 2005 10:24:27 -0400
- Subject: Re: Broken cast in linux-thread-db
- References: <jebr1uu8lk.fsf@sykes.suse.de>
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