Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!nrl-cmf!ukma!rutgers!bellcore!faline!thumper!ulysses!hector!jss From: jss@hector.UUCP (Jerry Schwarz) Newsgroups: comp.std.c Subject: Defining Portable (Was: Invalid pointer addresses) Keywords: NULL, pointer Message-ID: <10595@ulysses.homer.nj.att.com> Date: 14 Sep 88 15:29:38 GMT References: <12088@steinmetz.ge.com> <8453@smoke.ARPA> Sender: netnews@ulysses.homer.nj.att.com Reply-To: jss@hector.UUCP (Jerry Schwarz) Distribution: na Organization: AT&T Bell Laboratories Lines: 33 In article <8453@smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: > >No, sorry. It happens to work (accidentally) in many cases on many >implementations, but since it can fail on some and is not guaranteed, >it is not "portable". The above illustrates an unfortunate shift that is occurring in the use of the phrase "portable code". When I use that phrase I mean that IN PRACTICE the code can be run on a large variety of systems. It is not a binary attribute, and it makes sense to say that one version of a routine is more portable than another because it works correctly in more environments. E.g. code that works on all UNIX systems is portable, but code that works on UNIX and DOS systems is more portable. Doug (and others) appear to be using "portable" to mean that the code whose behavior is guaranteed by the ANSI standard. Since the ANSI committee went to the trouble to invent a precise technical phrase, namely "stricly conforming", for this concept I suggest that we use that phrase when that is the intended meaning and continue to use "portable" for the less precise, but very important practical, concept associated with moving code between systems. Even a strictly conforming program may not be portable if the compiler on some important system has a bug or if the code makes an unreasonable assumption about the availability of some resource. And on the other hand, a program that, in Doug's words, "works (accidentally) in many cases on many implementations" can reasonably be described as moderately portable even if it is not strictly conforming. Jerry Schwarz AT&T Bell Labs, Murray Hill