Hacker News new | ask | show | jobs
by rbabich 5891 days 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) { }
1 comments

Being 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.