logoalt Hacker News

Filligreetoday at 12:00 PM1 replyview on HN

Print x twice. Not all “side effects” care about order.

Better yet, define an order for parameter evaluation.


Replies

poppadom1982today at 12:43 PM

You're missing the point. Volatile forces two loads of a value that may have changed in the middle. So the value of "x" may depend on the time/order of load.

show 2 replies