[comp.lang.misc] To typecheck, or not to typecheck

throopw@dg_rtp.UUCP (Wayne Throop) (01/10/87)

> putnam@steinmetz.UUCP
> In a large system, lint looks at everything, and in "edit-run-think-debug..."
> loops, the overhead of lint is unnecessary and unhelpful. (I change a
> loop from "for (i=0 ; i < 100 ; i++)" to "for (i=0 ; i < 101 ; i++)", and
> need to re-lint the file.  Absurd.

Now, now.  This is hardly "absurd".  I assume this loop has a body.  And
I assume that "i" is used in the body.  Let's say, it is used as an
array index.  You mean you don't want to check to see that it can't
violate the array bounds?  There are, I suppose, changes trivial enough
so that typechecking is redundant.  But these are surprisingly rare.
Most errors creep in in those last-minute tweaks, changing things that
"couldn't possibly" have global impact.

However, given that typechecking is separate from compilation in C, I
typecheck overnight to save time.  Thus, when I make silly blunders that
"couldn't have global impact", I get hauled up short in next morning's
error report.

--
"Compilers produce object modules.
 Typecheckers produce lists of errors.
 But compilers can't guarantee to produce correct object code in the
 face of errors, so one should ALWAYS typecheck."
                                --- Overheard somewhere-or-other
-- 
Wayne Throop      <the-known-world>!mcnc!rti-sel!dg_rtp!throopw