4 ms·
I can't say I've tried it, but shouldn't this be enough to avoid the optimization? volatile int i=1; while (i) { }
by rbabich 17y ago
I can't say I've tried it, but shouldn't this be enough to avoid the optimization?
volatile int i=1;
while (i) { }
- tetha 17y agoBeing volatile, i can change in ways which cannot be deduced from the program code. Thus, the loop loops until something which cannot be deduced from the program code happens. Thus, yes.