OK, How about this? I tried to make everyone happy :-) Here is an excerpt: #ifdef HAVE_STDINT_H #include #define CORE_ADDR_CAST (uintptr_t) #else #define CORE_ADDR_CAST (CORE_ADDR)(unsigned long) #endif . . . last_stopped_data_address = CORE_ADDR_CAST siginfo.si_addr; Then when there is a gdb_stdint.h, I'll submit another patch to include it and replace CORE_ADDR_CAST with just (uintptr_t). Ok to commit? -=# Paul #=- On Fri, 2006-05-05 at 18:49 +0200, Mark Kettenis wrote: > > 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