Microsoft Visual C++ (MSVC) is a C/C++ compiler by Microsoft for Windows.

Flags

Assume flags are prefixed with / (as is standard in Microsoft-land).

  • permissive and permissive-, to enable/disable non-standards conformant compilation.
    • /permissive is the default for C++14 and C++17. /permissive- is the default for C++20 and beyond.
    • i.e., /permissive implies that code that may be syntactically invalid with other compilers may compile fine with MSVC. This is horrible for compatibility!1
  • /Zc is a family of options to enable/disable standards conformance vs. an MSVC-specific extension to the language.2
    • /Zc:nrvo controls NRVO behaviour. If on, the compiler will apply it wherever possible. By default, the flag is set with /O2, /permissive-, or /std:c++20.3

See also

  • GCC and Clang, competing C/C++ compilers

Footnotes

  1. Challenges and Benefits of Upgrading Sea of Thieves From C++14 to C++20, by Keith Stockdale at Rare Ltd.

  2. /Zc (Conformance) | Microsoft Learn

  3. /Zc:nrvo (Control optional NRVO) | Microsoft Learn