The trouble with volatile
Posted May 14, 2007 15:07 UTC (Mon) by BenHutchings
In reply to: The trouble with volatile
Parent article: The trouble with volatile
"People might argue that it is useful with signals or longjmp(), but the need for volatile in such scenarios is always an indication of a serious problem in the code."
These are the two cases defined by the standard where volatile *must* be used for certain variables. Memory-mapped I/O is the third case it was intended for, but as that's inherently unportable the standard doesn't explicitly mention it. (I think the rationale does.)
to post comments)