Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!cmcl2!yale!husc6!mit-eddie!genrad!panda!teddy!jpn From: jpn@teddy.UUCP (John P. Nelson) Newsgroups: comp.lang.c Subject: Re: Check the Arg Count (really lint libraries) Message-ID: <3663@teddy.UUCP> Date: Mon, 12-Jan-87 14:02:51 EST Article-I.D.: teddy.3663 Posted: Mon Jan 12 14:02:51 1987 Date-Received: Thu, 15-Jan-87 03:05:45 EST References: <3214@bu-cs.BU.EDU> <4900@mimsy.UUCP> <1193@ucbcad.berkeley.edu> <802@wjvax.wjvax.UUCP> <1887@utah-gr.UUCP> <589@rtech.UUCP> Reply-To: jpn@teddy.UUCP (John P. Nelson) Organization: GenRad, Inc., Concord, Mass. Lines: 36 In article <589@rtech.UUCP> daveb@rtech.UUCP (Dave Brower) writes: >Unfortunately, the big problem is that lint libraries so conceived do >not have anywhere near the same semantics as the "equivalent" object >libraries. > > ... > >Would life be easier in this case if every .c file compiled into a library >had the magic /*LINTLIBRARY*/ comment? This helps quite a bit, but does not solve all the problems. I modified our lint to insert the /*LINTLIBRARY*/ comment into the stream of source being used to generate the lint library - this is sort of like using -u only on the lint library part of your lint run. We have made LOTS of other changes to our lint as well, so it would be hard to post a diff. This does not solve various scoping problems: For instance if I define a static function write() in a library with different parameters than the system write, I will get a lint cross-check error against llib-lc.ln Here is the modified part of lint (originated as ULTRIX lint (BSD4.2)): The relevant line used to be: *) echo "$A:" ; (/lib/cpp $O $A | ${L}1 $X >>$T)2>&1 change this to: *) echo "$A:" if [ "X$C" != X ] then ((echo "/* LINTLIBRARY */" ; /lib/cpp $O $A) | ${L}1 $X $U >>$T)2>&1 else (/lib/cpp $O $A | ${L}1 $X $U >>$T)2>&1 fi