lint on Altos 2000 is BROKE BROKE BROKE!
Rich Salz
rsalz at bbn.com
Tue Jul 26 05:44:34 AEST 1988
In comp.lang.c (<264 at oglvee.UUCP>), jr at oglvee.UUCP (Jim Rosenberg) writes:
>Sigh ... Does anyone know how to remake
>the .ln files on various versions of lint?
Here's the key. In most Unix-derived systems, lint has three passes --
cpp, lint1, lint2 -- usually controlled by a driver written in /bin/sh.
To make a lint library, you have to basically feed your lint library
through the first two passes, collect the output, and feed it to the
last pass whenever you want it.
In essence, then, you'll have to do something like this (split over
multiple lines for readability):
/lib/cpp -Dlint ${other -D -I -U options from the command line}
YOURLINTFILE.c
| $(LINTLIB)/lint1 ${lint flags from command line}
>$(LINTLIB)/llib-lYOURLINTFILE.ln
The LINTLIB variable will typically be /usr/lib or /usr/lib/lint.
The direct call to /lib/cpp is probably not the best way to do it.
Of the lint flags, most don't count or aren't needed; you probably want
to use -v and -u, although if you have "/* LINTLIBRARY */" in your source
than you don't need the -u. And, if you write your library so that every
variable is used, you don't need the -v, as in:
int chmod(f, m) char *f; int m; { f = f; m = m; return(0); }
Now that you've made the library, how do you use it? Typically the
"-lFILE" option tells the lint driver to feed the file
$(LINTLIB)/llib-lFILE.ln into the second pass, where things like inter-module
checking are done. So, if you name your file as shown in the fragment
above, you should be okay.
Hope this helps.
/rich $alz
--
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
More information about the Comp.lang.c
mailing list