Betrayed by a bitfield
Posted Feb 4, 2012 21:47 UTC (Sat) by giraffedata
In reply to: Betrayed by a bitfield
Parent article: Betrayed by a bitfield
That's very interesting, because it seems to say the provision for "volatile" is so incomplete as to be a pointless language feature. "volatile" was supposed to deal with C programs running in an address space that includes memory mapped I/O regions. But if the compiler is allowed to write whatever it wants whenever it wants into I/O regions, just as long as it doesn't expect it to stay there, what's the point? You can't confidently run a C program in an address space that contains memory mapped I/O regions.
Maybe it's useful in read-only memory mapped I/O regions that just ignore writes.
to post comments)