Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: keep up with C++

An object that has volatile-qualified type may be modified in ways unknown to the implementation or have other unknown side effects. Asynchronous signal handling falls into this category. Without this type qualifier, unintended optimizations may occur. These optimizations may cause race conditions, because a programmer may write code that prevents a race condition, yet the compiler is not aware of the programmer's data model, and may modify the code during cmopilation to permit race conditions.

Wiki Markup
The {{volatile}} keyword eliminates this confusion by imposing restrictions on access and caching. According to the C99 Rationale \[[ISO/IEC 03|AA. C References#ISO/IEC 03]\]:

...