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

Joel Brobecker
2009-01-08T11:25:01Z

> 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