*BSD News Article 84383


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!su-news-hub1.bbnplanet.com!venus.sun.com!news2me.EBay.Sun.COM!engnews2.Eng.Sun.COM!engnews1.Eng.Sun.COM!infernal!richardt
From: R!ch <richardt@uk.sun.com>
Newsgroups: comp.unix.solaris,comp.unix.bsd.misc,comp.unix.internals
Subject: Re: Solaris 2.6
Date: Fri, 6 Dec 1996 13:55:36 +0000
Organization: Sun Microsystems Inc., Mountain View, CA
Lines: 40
Distribution: inet
Message-ID: <Pine.SOL.3.93.961206135309.3099R-100000@infernal>
References: <32986299.AC7@mail.esrin.esa.it> <57djlg$bks@agate.berkeley.edu>   <57dkbq$bsr@panix2.panix.com> <casper.329abb76@mail.fwi.uva.nl>   <x7917mx5gx.fsf@dumbcat.codewright.com> <casper.329d5a07@mail.fwi.uva.nl>   <5869r2$175$1@asgard.sprintlink.co.za> <587mc1$1dc@cucumber.demon.co.uk> <casper.32a804ad@mail.fwi.uva.nl>
NNTP-Posting-Host: infernal.uk.sun.com
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Sender: richardt@infernal
To: "Casper H.S. Dik" <casper@fwi.uva.nl>
In-Reply-To: <casper.32a804ad@mail.fwi.uva.nl>
Xref: euryale.cc.adfa.oz.au comp.unix.solaris:91610 comp.unix.bsd.misc:1700 comp.unix.internals:11479

On 6 Dec 1996, Casper H.S. Dik wrote:

> andrew@cucumber.demon.co.uk (Andrew Gabriel) writes:
> 
> >Out of curiosity, how would you print a pointer (for debugging say)?
> 
> >char *ptr;
> >printf("pointer = 0x%lx", (long) ptr);
> 
> >How should it be done portably?
> 
> 
> Portably?  I don't know.  When we get a 64 bit Solaris, pointers and
> longs will still be the same size.
> 
> Does DU have a %p printf directive?  Perhaps that is even on some
> standards track?

ISTR that %p is the ANSI standard way of printing a pointer's value.

Regular readers will be aware of how unreliable my memory can be at
times.  :-)

--
R!ch

If it ain't analogue, it ain't music.
#include <disclaimer.h>                    \\|// - ?
                                           (o o)
    /==================================oOOo=(_)=oOOo========\  .   *   .   .*
    |  Richard Teer                richard.teer@uk.sun.com  |   .  . /\ ( .  . *
    |  Sun Service Contractor                               |  . .  / .\   . * .
    |                            Voice: +44 (0)1276 691974  |  *.  / *  \  . .
    |                                 .oooO                 |   . /*   o \     .
    |                                  (  )  Oooo.          |     '''||'''   .
    \===================================\ (==(   )==========/ ******************
                                         \_)  ) /
                                             (_/