%p and different pointer representations

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Feb 25 12:33:58 AEST 1989


In article <16112 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>I think this is what is known as an oversight (and goes to show why
>standards committees should avoid inventions)....

No, it's not an oversight.  Obviously we could not require generic
object pointers to be large enough to act as generic function pointers
also.  This is clearly reflected in the specification for void *.
A second kind of generic pointer would have had to been invented to
hold function addresses.  We didn't invent one, on the grounds of
"insufficient utility".  Personally I would rather the %p format not
have been introduced, but given the existence of void *, it was a
natural addition.

It is pretty easy to snipe at X3J11's work and imply that you could
have done better, but I note that you didn't help formulate the
standard.  If you had any constructive criticism to offer, you should
have done so during the public review process.



More information about the Comp.lang.c mailing list