About Go, D module naming

Jonathan M Davis jmdavisProg at gmx.com
Fri Dec 21 11:37:47 PST 2012


On Friday, December 21, 2012 20:29:43 Joseph Rushton Wakeling wrote:
> On 12/21/2012 06:59 PM, Jonathan M Davis wrote:
> > A lint-like tool is free to point them out for you, and maybe an IDE could
> > highlight them, but actually making the compiler consider unused variables
> > to be either a warning or an error would be an incredibly bad idea for D
> > - on top of the fact that it would be really annoying.
> 
> How about a separate compiler flag to warn about this issue alone? Useful
> for those who want these checks, doesn't affect those who don't.

Not only are there perfectly legitimate uses for having used variables (e.g. 
RAII), but if used in combination with -w, such a flag would actually change 
the semantics of programs (due to have it affects conditional compilation), 
which is a major no-no. That and the fact that Walter has previously shown 
distaste both for warning about unused variables and for having lots of 
compiler flags, and I'd be very surprised if he added it. IDEs or or other 
tools are free to warn about it, but I think that it's a _very_ bad idea for 
the compiler itself to do so.

- Jonathan M Davis


More information about the Digitalmars-d mailing list