What does the warning “constant conditional branch” mean?
Typically this warning will only occur if the global optimizer is enabled and the index to a for() statement is auto. What happens with something like: for(i=0; i!=10; i++) whatever; Is that the global optimizer tracks the value of “i” after the expression “i=0”. It then comes the expression checking to see if i is not equal to 10. The optimizer says, of course it is not equal to 10, you just set it to zero, and issues the warning. Now you might say that this is in a for() statement, but the trouble is that at this point, for()s have been converted into simpler psuedo code ready for code generation, which if it could be represented in C would be equivalent to: i=0; label2: if(i==10) goto label1; whatever; i++; goto label 2; label1: So to be able to detect that the comparison is part of a for() at this point requires looking ahead and trying to sort out all the jumps. Now, if the optimizer is enabled and this “condition” is detected (and warning issued) the psuedo code is simplified: i=