Henry Spencer, The Ten Commandments for C Programmers
plint attempts to detect features of C programs which, although perhaps legal, are likely to be bugs. plint checks type usage more strictly than the parasite cross-compiler. Questionable constructs that plint can sometimes find include functions called with varying numbers of arguments, variables and functions that are declared but not used, statements that cannot [logically] be reached, and logical expressions whose value is constant.
Just as only modified source files need be re-compiled, only modified source files need be re-linted. An appropriately structured makefile facilitates both goals. The net result is that plint never need be invoked manually -- it can happen automatically (and efficiently) as an opening act for the compiler. Given the expense of finding and correcting bugs in parasite programs, incremental/continual linting is highly reccomended. Here's an example makefile:
EXP=93081 CC=qcc CFLAGS=-DDEBUG LINT=plint INCS=main.h SRCS=stim.c data.c main.c runtr.c disp.c feedbk.c misc.c error.c OBJS=stim.o data.o main.o runtr.o disp.o feedbk.o misc.o error.o LNTS=stim.ln data.ln main.ln runtr.ln disp.ln feedbk.ln misc.ln error.ln $(EXP): $(OBJS) $(LINT) $(CFLAGS) $(LNTS) $(CC) -s $(OBJS) -o $@ $(OBJS): $(INCS) clean: #no pre-reqs rm -f $(OBJS) $(EXP) $(LNTS) .c.o: $(LINT) -i $(CFLAGS) $< $(CC) -c $(CFLAGS) $<Note that when used incrementally plint creates .ln files e.g. runtr.ln. These .ln files are to plint as .o files are to qcc. make clean (with the above makefile) removes .o and .ln files.