On Fri Sep 30, 2005 at 10:28:18 +1000, Ian Wienand wrote:
>On Fri, Sep 30, 2005 at 10:22:33AM +1000, Benno wrote:
>> (Of course using printf then becomes a real bitch...)
>
>What's wrong with the PRI macros in inttypes.h?
>
Compare:
uint32_t foo = 0x37;
uintptr_t bar = (uintptr_t) &foo;
printf("Foo: " PRId32 " bar: " PRIxPTR "\n", foo, bar);
with:
int foo = 0x37;
long bar = (long) &foo;
printf("Foo: %d bar: %lx\n", foo, bar);
I find the second clearer, but that might just be me ;)
Benno
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html