"so" <s...@so.do> wrote in message news:op.vlubxy2a7dt...@so-pc...
>> int i;
>> i = i + 5;
>
> I can't see any uninitialized var there, can you? :P
>

There's no usage of an undeclared variable, but the right-hand-side of the 
second line uses 'i' before *the programmer* initializes it. Yes, the D 
compiler chooses to automatically initialize it, but by doing so it silently 
creates a bug every time the programmer intends 'i' to start out as anything 
other than 0. And it's not easily noticed since 0 is a commonly-used value. 
(Something like 0xDEADBEEF would at least be an improvement (albeit a small 
one) since at least that would stand out more and likely fail more 
spectacularly.) 


Reply via email to