Compiler does some flow analysis with -O..?

Nick Sabalausky a at a.a
Thu Apr 9 09:36:43 PDT 2009


"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... 





More information about the Digitalmars-d mailing list