Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!ncar!ico!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Novice MicroSoft C5.1 question Message-ID: <17179@haddock.ima.isc.com> Date: 30 Jul 90 21:28:54 GMT References: <9609@tekigm2.MEN.TEK.COM> <31530011@hpcvia.CV.HP.COM> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 16 In article <31530011@hpcvia.CV.HP.COM> brianh@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@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'.