> Also, the volatile keyword does not tell the compiler not to optimize. It > tells the compiler that the volatile variable must be saved after > modification.
Thank you for the info. I stand corrected :) > Many compilers will leave the result in a register, and may > never even allocate memory for a variable. In the non-volatile case, > neither 'iterations' nor 'i' ever are stored in memory. If I'm reading what you said correctly, then the volatile keyword is still performing as intended. I.e., if the variable must be saved after modification, then the compiler can't optimize out the for loop. It must increment the variable i until the test condition is false. Yes, it may optimize by putting it into a register so the entire loop is executed within the processor (no fetches from RAM). But, AFAIK the compiler is always free to put any variables it wants to into registers. Am I missing something?? Thanks, Warren ***************************************************************** To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *****************************************************************
