%p and MSC

Colin Plumb colin at array.UUCP
Sun Aug 5 09:57:46 AEST 1990


In article <444 at demott.COM> kdq at demott.COM (Kevin D. Quitt) writes:
>
>    %p represents a bug in Microsoft's documentation.  As I had quoted
>it earlier, their documentation does indicate that they are not ANSI
>compliant; testing, however, has indicated that MSC *is* ANSI compliant
>for those models where data and code have the same size pointer (S,L,H). 
>Those models with mixed addressing modes (C,M) cause a problem because
>it is impossible for printf to differentiate between code and data
>pointers.

It shouldn't have to... are you passing it something other than void *
(as required in 4.9.6.1)?

Of course, in models where data pointers are smaller than code pointers,
you will encounter the fact that ANSI doesn't guarantee that pointers to
functions can be cast to void * without losing information...  In other
words, there is no ANSI-conformant way to print pointers to functions
(why would you want to in portable code, anyway?)
-- 
	-Colin



More information about the Comp.lang.c mailing list