http://d.puremagic.com/issues/show_bug.cgi?id=3960



--- Comment #12 from bearophile_h...@eml.cc 2011-06-11 02:41:14 PDT ---
(In reply to comment #11)
> (In reply to comment #8)
> > This is accepts-invalid, not an enhancement request.
> > 
> > http://www.digitalmars.com/d/1.0/function.html
> > "It is an error to declare a local variable that is never referred to."
> 
> See:
> http://www.digitalmars.com/d/archives/digitalmars/D/bugs/2105.html
> http://www.digitalmars.com/d/archives/digitalmars/D/Re_Wish_Variable_Not_Used_Warning_73539.html
> 
> It actually seems more likely that this is a bug in the spec, as I think 
> Walter
> is against pretty much anything that requires flow analysis.

In the beginning this was an enhancement request, now someone has made it a
kind of error. But in the end the situation is the same. In most cases in well
written code you don't want unused variables, and various experiments have
shown that unused experiments are often associated with bugs. On the other hand
lint tools in C that are able to spot such unused variables are seldom used,
and several of the most used compilers do spot such unused variables today. So
I conclude that I'd like the D compiler to spot them automatically for me.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to