YALF (yet another lint foulup)

Guy Harris guy at auspex.UUCP
Tue Dec 20 17:27:53 AEST 1988


>I believe that /*NOTREACHED*/ is for things like exit(), which cannot return
>at all.  Given that LINT professes to know about variables used before set,
>it is certainly LINT's business to do a little basic flow analysis.  It
>would be nice if LINT would warn that this ``loop'' does not and can not loop.

That's nice; unfortunately, the S5R3 "lint" doesn't really back this
belief up - it merely gives "exit()" as an example, and just says that
"at appropriate points (it) stops comments about unreachable code." It
would be nice if "lint" did a better job of flow analysis; however,
until it does, I see little point in *not* using /*NOTREACHED*/ to quiet
the noise from "lint" so that one can do a better job of finding the
signal.

>With ANSI C and function prototypes, we may hope that LINT goes away.  We
>now understand better what sort of checks to apply (Bjarne Stroustrup's C++
>processors do a much better job than LINT, and without the extraneous noise)
>and it makes sense to put them in the compiler.

Well, perhaps.  Some of the "-h" checks ("h" can stand either for
"heuristic" or "hack") are useful, even though they could be considered
hacks; they warn of perfectly legal constructs that are generally the
result of a slip of the fingers.



More information about the Comp.lang.c mailing list