Check the Arg Count (really lint libraries)

John P. Nelson jpn at teddy.UUCP
Tue Jan 13 05:02:51 AEST 1987


In article <589 at rtech.UUCP> daveb at 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



More information about the Comp.lang.c mailing list