6 ms·
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.embe
by anonymousiam 11mo ago
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-use-the-volatile-keyword-embedded-c-programming https://www.embeddedrelated.com/thread/4749/when-and-how-to-...
- mattnewport 11mo agoThat's not really "fooling" the optimizer, that's kind of the point of volatile. The optimizer not making optimizations is the intended behaviour.
- anonymousiam 11mo agoYou're right, but the article failed to mention that there was a way around the optimizations.
- 1718627440 11mo agoFooling for you is making someone not do X by telling them not to do X?