As I told, the compiler, when optimizations are on, initialize the value
just before its use!.
So in the first case initialization happen immediatly because the first source line use it in printf, in the second case you make two actions that will not change the value (increment than decrement the value doesn't change value befor its use).
This is due to the fact that PellesC has a very strong optimizer, that recognizes unconsistent code generation (why produce two instructions when the first use of that variable will keep the original value?)
This simply demonstrates that PellesC is
very efficient If you try:
i++;
printf ("this is %d\n", i);
i--;
You'll see that increment/decrement are effectively generated.
As more prove if you define and initialize a variable that you never use you'll get a warning and the variable is not allocated at all.
Anyway, while everybody forget to mension, you have always to disable optimizations while producing debuggable executable (M$ make it by default in debug version).
So no bug at all, but a good compiler (I couldn't expect less by Pelle
).