Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!ut-sally!utah-cs!utah-gr!donn
From: donn@utah-gr.UUCP (Donn Seeley)
Newsgroups: comp.lang.c
Subject: Re: Check the Arg Count
Message-ID: <1887@utah-gr.UUCP>
Date: Thu, 8-Jan-87 17:07:25 EST
Article-I.D.: utah-gr.1887
Posted: Thu Jan  8 17:07:25 1987
Date-Received: Thu, 8-Jan-87 23:49:22 EST
References: <3214@bu-cs.BU.EDU> <4900@mimsy.UUCP> <1193@ucbcad.berkeley.edu> <802@wjvax.wjvax.UUCP>
Organization: University of Utah CS Dept
Lines: 53
Summary: I don't see what the problem with lint libraries is supposed to be

Brett Galloway complains:

	...  [Lint] provides the ability to create lint libraries.
	Unfortunately, lint treats these libraries differently than cc
	treats object libraries.  It would be most useful for
	maintaining large pieces of software if lint behaved the same
	as cc -- lint'ing source files into some intermediate form,
	finding all lint errors unique to that source file (this is
	analogous to the compile cycle), and lint'ing the intermediate
	lint files together to find global errors (this is analogous to
	the load cycle).  This would make lint easier to use,
	especially from within makefiles. ...

Lint (under BSD Unix and probably most other varieties) works exactly
like cc, 'compiling' into an intermediate form and 'loading' the
result.  You can read the lint shell (/usr/bin/lint) to find out more
about how lint works.

It's really simple to build big lint libraries using a makefile to
avoid re-linting individual source files.  Try something like this:

------------------------------------------------------------------------
.SUFFIXES: .ln

.c.ln:
	lint -CTEMP $(LINTFLAGS) $*.c
	-mv llib-lTEMP.ln $@

CPPFLAGS=	-DDEBUG
LINTFLAGS=	-h $(CPPFLAGS)
CFLAGS=		-g $(CPPFLAGS)

OBJECTS=	fu.o bar.o
LINTINTS=	fu.ln bar.ln

all:	libfubar.a llib-lfubar.ln

libfubar.a:	$(OBJECTS)
	ar crv libfubar.a $(OBJECTS)

llib-lfubar.ln:	$(LINTINTS)
	cat $(LINTINTS) > llib-lfubar.ln
------------------------------------------------------------------------

This example causes lint files to be produced independently of object
files; if you so desired, you could change the '.c.o' rule
appropriately so that lint is always run when a file is recompiled.
Note that for a program rather than a library, you might write a
makefile line like 'lintall:; lint $(LINTFLAGS) $(LINTINTS)' instead
of using 'cat' to build a library.

Donn Seeley    University of Utah CS Dept    donn@cs.utah.edu
40 46' 6"N 111 50' 34"W    (801) 581-5668    utah-cs!donn