Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated information about MSVC and GCC; Reviewed

...

(See also undefined behavior 65 in Appendix Annex J of the C Standard.)

Noncompliant Code Example

...

This example compiles without warning on Microsoft Visual Studio 2012 when compiled in C mode (/TC), but causes errors when compiled in C++ .NET mode (2003) and on MS Visual Studio 2005.

This example does not compile on MS Visual Studio 2008. The error message is

Code Block
error C2440: '=' : cannot convert from 'int **' to 'volatile int **'

/TP).

Version 4.8.1 of GCC generates a warning but compiles Versions 3.2.2 and 4.1.3 of the GCC compiler generate a warning but compile successfully.

Compliant Solution

...