Use of lint (4.2bsd)

Brett Galloway brett at wjvax.UUCP
Fri Aug 15 09:54:11 AEST 1986


I am currently working on some software in which I have created a number
of object libraries, and then I use those libraries to create my executables.

My question is how to use lint in an effective manner with these libraries,
on a 4.2 BSD system.  I would like to perform two tasks with lint.  First, I
would like to generate from each library directory a lint library for the
use of the higher-level libraries and top-level source.  Second, I would
like to run lint on the source files in each library and on the top-level
source files using the relevant lint libraries.  Therefore, I tried the
following construction in my makefile: (edited)

	CFILES=		<list of .c files in the library>
	LIBMISCname=	MISC
	LLIBMISC=	../llib-l$(LIBMISCname).ln
	LLIBS=		../llib-lGENERAL.ln <more lint libraries>
	LINT=		lint -I../../include -DLINT

	$(LLIBMISC):	$(CFILES)
		$(LINT) -C$(LIBMISCname) $? $(LLIBMISC)	[1]
		$(LINT) -h $(CFILES) $(LLIBS)		[2]
		@mv llib-l$(LIBMISCname).ln $(LLIBMISC)	[3]

The first line ([1]) supposedly lints the C source files that are out of date
together with the current lint library and drops a new library llib-lMISC.ln,
which I move onto the real lint library at the end (line [3]).

The second line ([2]) supposedly lints ALL the source files (since a change to
a given source file may make other unchanged C files fail which formerly
passed) together with the other relevant lint libraries.

My first question is whether my construction is correct and performs (in
the best way) what I want to do.

My second question concerns one incidental failure of this method.  My lint
documentation says that the standard C library is checked by default.  Yet
when I use this makefile for one particular library, I get complaints for the
following:

	Variable number of arguments in fprintf()
	Variable _iob used but not defined
	Variable errno used but not defined
	Variable _ctype_ used but not defined

Yet when I read /usr/lib/lint/llib-lc (the human-readable form of the standard
C lint library), I find definitions for _iob, errno, and _ctype_; and
fprintf() is declared as /*VARARGS*/.  Why, then, is lint complaining?

-------------
Brett Galloway
{pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett
-- 
-------------
Brett Galloway
{pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett



More information about the Comp.lang.c mailing list