Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sometimes you can fool the (C) optimizer by using the 'volatile' keyword in front of a variable in code that would otherwise be optimized out.

https://www.embeddedrelated.com/thread/4749/when-and-how-to-...



That's not really "fooling" the optimizer, that's kind of the point of volatile. The optimizer not making optimizations is the intended behaviour.


You're right, but the article failed to mention that there was a way around the optimizations.


Fooling for you is making someone not do X by telling them not to do X?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: