Wish: Variable Not Used Warning
Matti Niemenmaa
see_signature at for.real.address
Wed Jul 9 06:50:53 PDT 2008
Koroskin Denis wrote:
> 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
> {
> }
Just do:
void bar(int) {}
I.e. don't name the variable. And you will get an error if you try to use it
regardless, as you might expect. <g>
--
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi
More information about the Digitalmars-d
mailing list