LWN.net Logo

The trouble with volatile

The trouble with volatile

Posted May 11, 2007 6:45 UTC (Fri) by jzbiciak (✭ supporter ✭, #5246)
In reply to: The trouble with volatile by jzbiciak
Parent article: The trouble with volatile

Hmmm...

I did some playing around, and it appears different compilers treat the a = b = c case rather differently than I expected. Some *do* in fact read 'b' after writing it (which just seems crazy to me).

I've asked our compiler optimizer lead developer at work his take on this topic.

In the meantime, allow me to throw a mea culpa out there and then I'll shut up. :-)


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds