This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] convert a host address to a string


> By it you can use standard ISO type intptr_t. And I missed to add 
> inttypes.h.
> By this you could simply use PRIXPTR for printing hex pointer failues.
> 
> E.g.
>  fprint (fp, "0x%" PRIXPTR, (intptr_t) address);

That's pretty clever.  Bad luck for us, however. The MinGW inttypes.h
defines PRIxPTR as "I64x". When I tried with an example, I got a warning
because intptr_t is "long long int" whereas "%I64x" requires an unsigned
int. Changing the cast to uintptr_t helps a little, but it's not enough
since "unsigned int" is definitely not large enough to hold a pointer!

I really should report that to the MinGW guys!

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]