Wish: Variable Not Used Warning

Walter Bright newshound1 at digitalmars.com
Tue Jul 8 00:48:27 PDT 2008


Robert Fraser wrote:
> Walter Bright wrote:
>> Robert Fraser wrote:
>>> The compiler already has full semantic knowledge of the code, and at 
>>> least some of the warnings seem like "low-hanging fruit" so why not 
>>> make the compiler act as a "mini-lint"?
>>
>> Generally for the reasons already mentioned.
>>
>> Warnings are properly in the scope of static analysis tools, which 
>> have a different purpose than a compiler.
> 
> A compiler is not a documentation generator or a header generator, yet 
> DMD does both (with some switches). Why not the same with lint-like 
> functionality?

Because what constitutes a proper warning is a very subjective issue, 
there is plenty of room for different ideas. If it was in the compiler, 
it would inhibit development of static analysis tools, and would confuse 
the issue of what was correct D code.



More information about the Digitalmars-d mailing list