Compiler does some flow analysis with -O..?
Denis Koroskin
2korden at gmail.com
Thu Apr 9 10:43:35 PDT 2009
On Thu, 09 Apr 2009 20:36:43 +0400, Nick Sabalausky <a at a.a> wrote:
> "Denis Koroskin" <2korden at gmail.com> wrote in message
> news:op.ur4kb8ffo7cclz at soldat.creatstudio.intranet...
>> Now I am convinced:
>>
>> extern(C) int rand();
>>
>> void main()
>> {
>> int x = void;
>> if (rand() == 0) {
>> x += 5; // line 7
>> }
>> }
>>
>> test.d(7): Error: variable x used before set
>>
>> It only happens with DMD1.042+
>>
>> Yay!
>
> I guess I'm going to have to start using -O in my debug builds...unless
> this
> behavior becomes independant of the -O switch...wink wink nudge nudge...
>
>
Yeah, me too!
BTW, that's a breaking change! XD
More information about the Digitalmars-d
mailing list