Search code examples
c++visual-c++standards-compliance

Example of Visual C++ nonconformant code?


What are some examples of code that are not standards compliant when using visual C++? Something that is allowed to compile under visual C++ but nothing else.


Solution

  • You can find all the Microsoft language extensions here; you may also want to have a look to the areas of the language where VC++ is not compliant to the standard.

    One that I thought was standard (I noticed it when I enabled the /Za switch) is the "magic l-value cast":

    char *p;
    (( int * ) p )++;