delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/14/19:31:15

Date: Wed, 14 Jan 1998 19:29:49 -0500 (EST)
Message-Id: <199801150029.TAA22426@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
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");

> >> -- [ 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019