From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15801 invoked by alias); 12 Oct 2005 14:24:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15789 invoked by uid 22791); 12 Oct 2005 14:24:30 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 12 Oct 2005 14:24:30 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EPhWt-0005cD-Ji; Wed, 12 Oct 2005 10:24:27 -0400 Date: Wed, 12 Oct 2005 14:24:00 -0000 From: Daniel Jacobowitz To: Andreas Schwab Cc: gdb-patches@sources.redhat.com Subject: Re: Broken cast in linux-thread-db Message-ID: <20051012142427.GA21308@nevyn.them.org> Mail-Followup-To: Andreas Schwab , gdb-patches@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-10/txt/msg00105.txt.bz2 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