Can lint help an ANSI-C programmer?

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Thu May 31 21:25:42 AEST 1990


In article <00937758.16FBE220 at rigel.efd.lth.se> e89hse at rigel.efd.lth.se writes:
> I don't see what lint discovers that a C-compiler with prototypes can't
>discover, except wrong external declarations like: hello[100], char *hello.

Isn't that _enough_?

How is an ANSI C compiler, with just one file to look at, going to notice
that you've defined two functions with the same name in different files?
Yes, the linker will catch that one, but the linker won't tell you which
lines the definitions are on, and lint will.  And if you have set up a
lint-library file for a local library, lint can warn you about attempts
to redefine a function in the local library (an ANSI C compiler should
tell you about redefining standard library functions, but might not warn
you about conflicts with X) even though a linker might _not_ warn you
about multiple definitions.  (As the UNIX linker would not; it won't pull
a library entry in if the function is already defined.)

-- 
"A 7th class of programs, correct in every way, is believed to exist by a
few computer scientists.  However, no example could be found to include here."



More information about the Comp.lang.c mailing list