*BSD News Article 85133


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!nntp.coast.net!howland.erols.net!news.mathworks.com!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!tarrant.microlise.co.uk!news
From: andrewg@microlise.co.uk (Andrew Gierth)
Newsgroups: comp.unix.solaris,comp.unix.bsd.misc,comp.unix.internals
Subject: Re: printf, scanf and %p (was: Solaris 2.6)
Date: 12 Dec 1996 04:57:36 +0000
Organization: Microlise Engineering Ltd.
Lines: 23
Distribution: inet
Message-ID: <uf20cwmkan.fsf@zen.microlise.co.uk>
References: <32986299.AC7@mail.esrin.esa.it> <587mc1$1dc@cucumber.demon.co.uk>
	<casper.32a804ad@mail.fwi.uva.nl>
	<589ao6$lga@prometheus.acsu.buffalo.edu>
	<58bn6s$q7d$1@news.cs.tu-berlin.de> <mkl.850310924@rob.cs.tu-bs.de>
NNTP-Posting-Host: zen.microlise.co.uk
X-NNTP-Posting-Host: microl.demon.co.uk
In-reply-to: mkl@rob.cs.tu-bs.de's message of 11 Dec 96 13:28:44 GMT
X-Attribution: AG
X-Mayan-Date: Long count = 12.19.3.13.5; tzolkin = 12 Chicchan; haab = 8 Mac
X-Geek: (V3.1)
 GCS/IT/CC d-(pu) s:+> a- C++++$ UACHV++++$ P--- L E++ W(--) N+++ o? K? w---
 O+++ M- V-- PS+ PE Y+(--) PGP- t+@ 5+++ X R@ tv(-) b++ DI? !D G++ e h* !r y
X-Newsreader: Gnus v5.1
Xref: euryale.cc.adfa.oz.au comp.unix.solaris:92274 comp.unix.bsd.misc:1784 comp.unix.internals:11580

>>>>> "Mario" == Mario Klebsch <mkl@rob.cs.tu-bs.de> writes:

 Mario> js@cs.tu-berlin.de (Joerg Schilling) writes:
 >> You forget to say, that %p is guaranteed to produce an output format
 >> that may be read in again with *scanf(). So it is really portable.

 Mario> Is scanf("%p") on a system of type A supposed to read in the output of
 Mario> printf("%p) on a system of type B? Someone mentioned, the output of
 Mario> printf("%p") is implementation defined, which would lead to the
 Mario> conclusion, that is is not true.

A system with which I have the misfortune to be acquainted (not Unix)
produces the following output for printf("'%p'",some_pointer):

'SPP:0000 :1aefQPADEV0010T00AYG1   964158 :fec0:0:158c'

That pretty conclusively proves that %p output is not portable across
systems.

-- 
Andrew Gierth (andrewg@microlise.co.uk)

"Ceterum censeo Microsoftam delendam esse" - Alain Knaff in nanam