Super Lint

Walter Bright newshound at digitalmars.com
Wed Sep 20 12:33:15 PDT 2006


Pragma wrote:
> Walter Bright wrote:
>> I've been interested in various ideas for static checking for common 
>> bug patterns for D. For example:
>>
>>     for (int i = 0; i < 10; i++)
>>     {    foo();
>>         break;
>>     }
>>
>> would be flagged as a suspicious use of break. Are there any 
>> legitimate uses of break in this manner? Any thoughts and ideas in 
>> this direction?
> 
> 
> Well, one could throw from within foo(), but that would still abort the 
> loop on the first pass.  Nope, there's no legitimate use I can think of.
> 
> Are you considering making a lint tool for D?

Not exactly. Lint finds things that might be bugs, but my experience 
with Lint is it flags legitimate code patterns as bugs. I'd prefer to do 
things that are out and out bugs, like the example above.



More information about the Digitalmars-d mailing list