Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!philabs!prls!amdimage!amdcad!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.bugs.usg Subject: Re: "lint" lets very bad code pass Message-ID: <2556@sun.uucp> Date: Sat, 3-Aug-85 00:31:39 EDT Article-I.D.: sun.2556 Posted: Sat Aug 3 00:31:39 1985 Date-Received: Mon, 5-Aug-85 00:58:14 EDT References: <2454@sun.uucp> <189@kitty.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 34 > 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