[comp.lang.c] Portability check in lint

tomc@oakhill.UUCP (Tom Cunningham) (07/15/87)

I noticed that in the latest release of Sun 3 software which we have (I
believe it is 3.2), there is no -p option for lint to perform portability
checks.  This option does exist, however, in the System V version of lint
presumably distributed with the Sun 3.2 software.

Did Berkeley lint (if there is such a thing) ever have this option, was
it excised for some reason, or what?  I am just curious, as I consider
the constraints of eight character symbol names (six characters external)
as somewhat of an anachronism portability-wise, but I could well be wrong.

Would anyone care to comment on this?  Apologies if this topic has already
been discussed at length; in that case if someone could email me a brief
synopsis I would appreciate it.
-- 

Tom Cunningham     "Good, fast, cheap -- select two."
USPS:  Motorola Inc.  6501 William Cannon Dr. W.  Austin, TX 78735-8598
UUCP:  {ihnp4,seismo,ctvax,gatech}!ut-sally!oakhill!tomc
       sun!oakhill!tomc
Phone: 512-440-2953

guy%gorodish@Sun.COM (Guy Harris) (07/16/87)

> I noticed that in the latest release of Sun 3 software which we have (I
> believe it is 3.2), there is no -p option for lint to perform portability
> checks.  This option does exist, however, in the System V version of lint
> presumably distributed with the Sun 3.2 software.

The "-p" option is, in fact, supplied with the System V version of
"lint", but not with the 4.2 version.

> Did Berkeley lint (if there is such a thing) ever have this option, was
> it excised for some reason, or what?

Yes, there is a version of "lint" that comes with 4BSD; in fact,
there was a version of "lint" that came with V7.  Both those versons
have the option.

> I am just curious, as I consider the constraints of eight character
> symbol names (six characters external) as somewhat of an anachronism
> portability-wise, but I could well be wrong.

I suspect this may be why the "-p" was excised at Sun (I don't know
for sure, it happened before I joined).  The trouble with "lint -p"
is that it's *too* strict for most uses.  It checks for compatibility
with some old IBM 370 and GCOS dialects of C; this is why the the
6-character *one-case* external symbol name restriction is imposed.

Furthermore, instead of checking against the "lint" library for the
standard C library, it checks against some small library that
presumably represents the intersection of the libraries available
under the C implementations at Bell Labs.  (The version that comes
with the S5 "lint" seems larger than the version that comes with the
V7 and 4BSD "lint"s.  I don't know whether this reflects additions to
the OS or GCOS versions of the C library subsequent to the release of
V7, or not.)

The trouble is that there are some checks, performed only by
"lint -p", that are useful when porting to other UNIX
implementations, but specifying "-p" performs stricter checks than
are useful when testing for portability to UNIX C implementations (or
even to other modern C implementations).  There really needs to be an
option intermediate in stringency between "lint" and "lint -p";
"lint -p" itself is of limited use.
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com

gwyn@brl-smoke.ARPA (Doug Gwyn ) (07/16/87)

In article <23575@sun.uucp> guy%gorodish@Sun.COM (Guy Harris) writes:
>"lint -p" itself is of limited use.

I agree that the UNIX System V "lint -p" is not very useful to me either.
However, it would perhaps be useful in the near future for "lint" (no -p)
to check for inter-POSIX portability and for "lint -p" to check for inter-
X3.159 (ANSI C) portability, since those will be the two major vendor-
independent portable environments of interest.