Defining Portable (Was: Invalid pointer addresses)

Jerry Schwarz jss at hector.UUCP
Thu Sep 15 01:29:38 AEST 1988


In article <8453 at smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) 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



More information about the Comp.std.c mailing list