Quote:
|
Originally Posted by Jabo
actually, it will run once 17 is exceeded; if that ever happens. I haven't looked at the code to see.
|
Since it's initialized to zero there, the next statement that could modify it would be either in the loop (which won't execute if it's zero) or after the loop (in which case it's too late, because the loop is done). The only possible way this could execute is if some other process, thread, or hardware (think memory-mapped I/O) modified the variable in between the initialization and the test. As it wasn't declared
volatile, I don't see this happening, as the value would probably be cached in a register. In fact, given the lack of the
volatile keyword as a clue to the compiler, any intelligent optimizer would probably eliminate the loop entirely.