Wish: Variable Not Used Warning

Nick Sabalausky a at a.a
Sun Jul 6 00:38:50 PDT 2008


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:g4pplc$gno$1 at digitalmars.com...
> Nick Sabalausky wrote:
>> I don't suppose there's any chance of DMD getting a warning for 
>> variables/arguments that are declared but never accessed? Just today 
>> alone there's been two bugs I spent 10-30 minutes going nuts trying to 
>> track down that turned out to be variables I had intended to use but 
>> forgot to.
>
> The problem with unused variable warnings is they are annoying when you're 
> developing code in an iterative manner. They get in the way when you're 
> commenting out sections of code to try and isolate a problem. They can be 
> a problem when using "version" and "static if" statements.
>

I develop code in a highly iterative manner and find "unused variable" 
warnings highly useful. In all of the time I've spent with other compilers 
that do issue "unused variable" warnings, I've never found it to be an 
annoyance. And the way I've always seen it, warnings literally *are* a 
built-in lint tool. 





More information about the Digitalmars-d mailing list