[Patches] printf("%lx") -> printf("%p") for pointers : win64 cares

Tim Peters tim_one@email.msn.com
Sat, 13 May 2000 03:23:55 -0400


[Trent Mick]
> Do you have a suggestion for a good ANSI/ISO C reference?

The sad truth is hinted at here (among many other places; this is just the
first FAQ reference I hit):

    http://www.eskimo.com/~scs/C-faq/q11.2.html

ISO and ANSI derive a lot of income from selling standards, and ISO in
particular refuses to make any standard available over the web until it's
obsolete.  And there's really no substitute for having the actual standard
in hand.  Expect to fork out a few hundred bucks for a current "big" ISO
standard.

> It might more efficient for me to read these things than me
> playing, making patches, and having you teach me through
> comments on my patch. :)

It would actually be more efficient for *me* <wink> -- standards are written
in a strange language that only looks like English until you try to
understand them.  I only know this stuff because I worked on a C compiler in
a previous life.

> ...
> Given that %p is "implementation defined" do you see this patch
> going in

I'd put it in, if I were Guido.

> or will I have to #ifdef in %p usage for Win64 only until
> the magical C95 (is that what it will be called?

Another irritating possibility is to write your own function to convert a
void* to a hex string.  Then the #ifdef'ing would be needed only inside
that.

> ...
> Actually, will the next C standard define output for a pointer
> printf formatter.

Doubt it, but don't know.  I haven't worked on a C compiler in over 5 years,
and I certainly don't spend my own money on C standards <0.5 wink>.