Novice MicroSoft C5.1 question

Karl Heuer karl at haddock.ima.isc.com
Tue Jul 31 07:28:54 AEST 1990


In article <31530011 at hpcvia.CV.HP.COM> brianh at hpcvia.CV.HP.COM (brian_helterline) writes:
>To print out an address, use %p.  Also, it is important to know what memory
>model you are using.  The %p requires a far pointer.

For portable usage, you should cast the pointer to (void *); it's not always
true that `int *' and `void *' have the same representation.  Apparently MSC
requires you to also use the `far' keyword in some memory models, but if they
claim to be standard conforming, that's a bug%.

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint
________
% The very existence of a `far' keyword is non-Standard, but that's not what
  I'm talking about.  X3J11 says that `%p' matches `void *'.  If `void far *'
  has a different representation, there should be a different format specifier
  (e.g. `%Fp') to print it, so as to avoid breaking strictly conforming code
  that doesn't use `far'.



More information about the Comp.lang.c mailing list