digitalmars.D.bugs - Compiler allows unused locals
- "Lynn Allan" <l_d_allan adelphia.net> Oct 14 2004
- "Walter" <newshound digitalmars.com> Oct 19 2004
<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>
Oct 14 2004
Looks like a bug in the documentation. I'll fix it.
Oct 19 2004








"Walter" <newshound digitalmars.com>