October 14, 2004 Compiler allows unused locals | ||||
---|---|---|---|---|
| ||||
<alert comment="newbie"> On the documentation page: http://www.digitalmars.com/d/overview.html Compile Time Checks * Stronger type checking * Explicit initialization required * Unused local variables not allowed * No empty ; for loop bodies * Assignments do not yield boolean results * Deprecating of obsolete API's As of dmd ver 0.102, it seems like the compiler actually does allow unused local variables and applies implicit initialization to local variables. #void main () #{ # int unused; // compiler should complain? # int result; # int uninitialized; // implicitly initialized to 0 # result = uninitialized; // compiler should complain? #} </alert> |
October 19, 2004 Re: Compiler allows unused locals | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lynn Allan | Looks like a bug in the documentation. I'll fix it. |
Copyright © 1999-2021 by the D Language Foundation