Date: Wed, 14 Jan 1998 19:29:49 -0500 (EST) Message-Id: <199801150029.TAA22426@delorie.com> From: DJ Delorie To: blizzar AT hem1 DOT passagen DOT se CC: eldredge AT ap DOT net, djgpp AT delorie DOT com In-reply-to: <3.0.16.19980114103550.357f1ffa@hem1.passagen.se> (message from Peter Palotas on Wed, 14 Jan 1998 14:11:19 -0500) Subject: Re: printf("%p"); Precedence: bulk > >> -- [ Why isn't %p printed with a '0x' prefix ] -- > > `p' > > A pointer. This is printed with an `x' specifier. > > > >I interpret that to mean that "%p" works just like "%x", which it does. > > > >In any case, the way a pointer is printed is considered > >"implementation-dependent". It is not necessary that DJGPP print pointers > >the same way as any other system. Of course, if you have a compelling reason > >you think it should, let's hear it. > > Well, Linux does it that way for one, and DJGPP should be as compatible as > possible with Linux, don't you think? Not always. POSIX compliance, yes. Common practice, perhaps. We don't always side with Linux, because we're a DOS compiler, and some practices aren't all that common. In this case, Turbo C returns (i.e.) FF48 or 145E:8D30 SGI IRIX (another unix) returns (i.e.) 7fff2ef0 Linux is the odd-one-out in this case.