So where is a lint for ANSI C code?
Cesar Quiroz
quiroz at cs.rochester.edu
Wed Dec 27 14:54:11 AEST 1989
gumby at Gang-of-Four.Stanford.EDU (David Vinayak Wallace) wrote:
| But GCC and G++ by themselves are pretty good; with -Wall I doubt you
| need a special lint.
Some of lint's finest moments come when one runs it on *several* C
sources simultaneously. The usual style of Unix C compilation is to
perform separate runs on each file for object code production, but
just one lint run on the whole thing[1]. Admittedly, prototypes
catch one of the more common reasons for having all the files
visible at once (caller-callee disagreement). Still, a system-wide
checker that is not also expected to generate code could prove
useful.
Anecdote: once I helped some people debug a program that had a weird
case of def-def disagreement. I think it involved a program that
declared the same structure in two files, altering the order of two
of the fields. This was just poor coding, of course, but (1) none
of the -c compiles saw anything bad, (2) dbx just went crazy on it.
I recall that I insisted on a full-system lint and saw there the
double, inconsistent, definition. This was under Sun OS x.y, where
x was most likely something like 2). I tried reconstructing the
case for posting not long ago, but I failed under Sun OS 4; perhaps
someone more patient can produce an example based on the above
information.
Have a happy New Year! And let's hope we get a C standard this
year.
Cesar ( Why didn't they invent a trigraph to let me put an accent on
that e? I thought the C committee was into character set
standardization and transmission protocols too, right? :-)
[1] Unbelievers don't run lint at all. Naive believers run lint on
each file separately. None of these strategies is particularly
persuasive, although both yield plenty of excitement during
debugging.
--
Cesar Augusto Quiroz Gonzalez
Department of Computer Science
University of Rochester
Rochester, NY 14627
More information about the Comp.lang.c
mailing list