Content originally posted in LPCWare by Andrew24 on Fri Mar 26 10:02:15 MST 2010
Thanks for the answer. I had the optimisations turned off when i tried this.
This code, for example works perfectly while stepping,and i can see the variable changing:
[SIZE=2][LEFT][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]while[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](1) [/SIZE]
[SIZE=2]{
i++ ;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055] if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (i==10)
{
i=0;
}[/LEFT]
}
[/SIZE]
I undeststand ,that if there is a some kind of optimisations, the compiler probably will see i++ as unnecesarry action and will skip it, but with -O0 it's strange..