"lint" lets very bad code pass

Guy Harris guy at sun.uucp
Sat Aug 3 14:31:39 AEST 1985


> This is the first time I've heard that lint only checks for portability
> to non-UNIX systems.

Umm, well, actually it can either check:

	1) Whether the code is reasonably safe on the machine that "lint"
	   is running on - this also implies a check against the "standard"
	   C library instead of the "portable" C library.  On UNIX systems,
	   the "standard" C library includes all routines in sections 2
	   and 3 (well, it *should* include them - the 4.2BSD "lint"
	   library for the standard C library has many lacunae).  Also,
	   it assumes the "native" rules for identifier length.

	2) Whether the code is reasonably safe on any of the C
	   implementations it knows about - this includes UNIX,
	   GCOS, and, I believe, OS/360 and successors.  This implies
	   
	   a) assuming a set of data type lengths which are basically
	      those of a machine with 16-bit "int"s and pointers.

	   b) checking against a "portable" subset of the C library.
	   
	   c) a 6-character limitation on identifier length.

> Since UNIX runs on IBM mainframes shouldn't it complain about such things
> as "if(c<'0')", since this isn't portable to certain UNIX systems?

How so?  I believe the 370-and-clones UNIX implementations use ASCII - at
least some of them do.  Even if they used EBCDIC, I believe they use
unsigned "char"s, so the fact that some EBCDIC characters have the eighth
bit on shouldn't matter.   (Heck, the 3Bs have unsigned "char"s, and that
particular test is OK there.)

	Guy Harris



More information about the Net.bugs.usg mailing list