Wiki Markup |
---|
An object that has volatile-qualified type may be modified in ways unknown to the [implementation|BB. Definitions#implementation] or have other unknown side effects. It is possible to reference a volatile object by using a non-volatile value, but the resulting behavior is [undefined|BB. Definitions#undefined behavior]. According to C99 \[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\] Section 6.7.3, "Type qualifiers," Paragraph 5: |
If an attempt is made to refer to an object defined with a volatile-qualified type through use of an lvalue with non-volatile-qualified type, the behavior is undefined.
...
Accessing a volatile object through a non-volatile reference can result in undefined , and perhaps unintended program behavior.
...