From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20713 invoked by alias); 5 May 2006 16:50:53 -0000 Received: (qmail 20705 invoked by uid 22791); 5 May 2006 16:50:53 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 05 May 2006 16:50:48 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k45GnLFb019298; Fri, 5 May 2006 18:49:21 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k45GnKFt006511; Fri, 5 May 2006 18:49:20 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k45GnKob023219; Fri, 5 May 2006 18:49:20 +0200 (CEST) Date: Fri, 05 May 2006 16:50:00 -0000 Message-Id: <200605051649.k45GnKob023219@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: pgilliam@us.ibm.com, gdb-patches@sources.redhat.com In-reply-to: <20060505162955.GB31029@nevyn.them.org> (message from Daniel Jacobowitz on Fri, 5 May 2006 12:29:55 -0400) Subject: Re: [patch] Can't build ppc32 GDB References: <1145924338.18934.45.camel@dufur.beaverton.ibm.com> <1145924593.18934.48.camel@dufur.beaverton.ibm.com> <200604251938.k3PJc9dl014571@elgar.sibelius.xs4all.nl> <1146699224.16180.4.camel@dufur.beaverton.ibm.com> <25493.192.87.1.22.1146726734.squirrel@webmail.xs4all.nl> <20060505162955.GB31029@nevyn.them.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00067.txt.bz2 > Date: Fri, 5 May 2006 12:29:55 -0400 > From: Daniel Jacobowitz > > On Thu, May 04, 2006 at 09:12:14AM +0200, Mark Kettenis wrote: > > This is where the new ISO C99 types come in handy. Instead of > > casting to CORE_ADDR, try casting to uintptr_t. > > Can we rely on on GNU/Linux? I know we can't in general. > Conveniently, I have a patch on one of my pending branches that > provides a gdb_stdint.h. Having a gdb_stdint.h would be cool ;-). > But for this case there's an easier solution, which IIRC is roughly > what Paul did: I can pretty much promise you that sizeof (long) == > sizeof (void *) on any GNU/Linux system. So either I can merge > gdb_stdint.h and we can start using that, which might be a nice idea in > general, or for now I think "long" is fine. Well, we already use uintptr_t in linux-thread-db.c, and gdb_thread_db.h errors out if it isn't available (and has been doing so for ages). So we can be pretty sure that nobody is trying to compile on systems with libc5 or really old glibc versions. That said, it is probably safe to assume that all (powerpc) Linux ports are either ILP32 or LP64, so casting to (unsigned long) should be perfectly safe. It's just that I think that a uintptr_t cast better expresses what's happening here. But either way is fine with me. Mark