Wish: Variable Not Used Warning

Manfred_Nowak svv1999 at hotmail.com
Tue Aug 5 08:32:10 PDT 2008


Nick Sabalausky wrote:

> 1. There is no sufficient D lint tool either currently in
> existence or on the foreseeable horizon (at least as far as I'm
> aware). 

But this is at most a requirement for building a lint tool, not an 
argument for incorporating a lint tool into a compiler.


> 2. The compiler is already in a position to provide such
> diagnostics (and in fact, already does for certain other
> conditions). 

This again is no argument for a lint tool in a compiler. It is at most 
an argument for a case where there is some checking already built into 
a compiler then to be able to toggle its behaviour on or off. 

>> For at least huge parts of these latter tasks a reevaluation of
>> some static aspects of semantics of the application is useless
>> but time consuming.
> 
> Hence, optional.

But why optional? If one needs the code one needs no checking any more. 
If one needs the checking, one needs no code.


>> In addition and by definition lint tools are not capable of
>> doing more than this.
> 
> Which is part of what makes a compiler inherently more
> general-purpose, and a lint tool a mere symptom of a compiler's
> shortcomings. 

This is based on the assumption, that a compiler without a lint 
functionality has shortcomings, which has still to be proven.

> Plus, an
> external lint tool is, by necessity, going to incorporate a lot of
> duplicated functionality from the compiler (roughly the whole
> front-end).
> Although I suppose that could be moved into a shared
> library to avoid duplicated maintenance efforts. But since you
> mentioned that having lint work being done in the compiler would 
> be uselessly time consuming (Again, uselessly time consuming only
> if there's no switch to turn such checking on/off. Also, I assume
> you're referring to the speed of compiling), then I should point
> out that with an external lint tool, you're likely to have plenty
> of duplicated processing going on (lexing and parsing once for the
> external lint, and again for the real compiler). 

This is an argument only for having an intermediate representation 
suitable for the compiler and the lint tool. 

Interestingly IBM wants to sell the integration of a lint tool into the 
IDE:
http://www-306.ibm.com/software/rational/announce/swanalyzer/
 
-manfred

-- 
Maybe some knowledge of some types of disagreeing and their relation 
can turn out to be useful:
http://blog.createdebate.com/2008/04/07/writing-strong-arguments/



More information about the Digitalmars-d mailing list