Wish: Variable Not Used Warning

bearophile bearophileHUGS at lycos.com
Wed Jul 9 03:05:21 PDT 2008


Koroskin Denis:
> Moreover, I would be happy to have an `unused` modifier in addition to in,  
> out and inout (doh!) to denote that a variable is not going to be used. In  
> this case compiler will show an error if the variable is used by chance.  
> It could help programmer to catch potential bugs at early stage once he  
> eventually start using it. Besides, it really fits well into D, IMO:
> void bar( unused int foo ) // no warning is generated
> {
> }

Can you explain me in what practical situation(s) this can be useful?

Bye,
bearophile



More information about the Digitalmars-d mailing list