Xref: utzoo comp.unix.xenix:2780 comp.lang.c:11500 Path: utzoo!attcan!uunet!husc6!bbn!bbn.com!rsalz From: rsalz@bbn.com (Rich Salz) Newsgroups: comp.unix.xenix,comp.lang.c Subject: Re: lint on Altos 2000 is BROKE BROKE BROKE! Summary: Here's info on how to create lint libraries Message-ID: <1004@fig.bbn.com> Date: 25 Jul 88 19:44:34 GMT References: <326@ateng.UUCP> <264@oglvee.UUCP> Followup-To: comp.unix.xenix Organization: BBN Systems and Technologies, Inc. Lines: 37 In comp.lang.c (<264@oglvee.UUCP>), jr@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@uunet.uu.net.