Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/errorReport`](errorreport-report-internal-compiler-errors.md) | Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
| [`/execution-charset`](execution-charset-set-execution-character-set.md) | Set the execution character set. |
| [`/experimental:module`](experimental-module.md) | Enables experimental module support. |
| [`/experimental:preprocessor`](experimental-preprocessor.md) | Enables experimental conforming preprocessor support. |
| [`/experimental:preprocessor`](experimental-preprocessor.md) | Deprecated. Enables experimental conforming preprocessor support. Use [`/Zc:preprocessor`](zc-preprocessor.md) |
| [`/F`](f-set-stack-size.md) | Sets stack size. |
| [`/favor`](favor-optimize-for-architecture-specifics.md) | Produces code optimized for a specific x64 architecture. Or, for the specific micro-architectures in both the AMD64 and EM64T architectures. |
| [`/FA`](fa-fa-listing-file.md) | Creates a listing file. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Experimental options may only be supported by certain versions of the compiler.
| Option | Purpose |
|--|--|
| [`/experimental:module`](experimental-module.md) | Enables experimental module support. |
| [`/experimental:preprocessor`](experimental-preprocessor.md) | Enables experimental conforming preprocessor support. |
| [`/experimental:preprocessor`](experimental-preprocessor.md) | Deprecated. Enables experimental conforming preprocessor support. Use [`/Zc:preprocessor`](zc-preprocessor.md) |

## Deprecated and removed compiler options

Expand Down
5 changes: 2 additions & 3 deletions docs/build/reference/compiler-options.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: Compiler Options"
title: "MSVC Compiler Options"
ms.date: "05/06/2019"
ms.date: "12/14/2020"
helpviewer_keywords: ["cl.exe compiler", "x86 MSVC compiler", "ARM MSVC compiler", "compiler options, C++", "x64 MSVC compiler"]
ms.assetid: ed3376c8-bef4-4c9a-80e9-3b5da232644c
---
# Compiler Options

Expand All @@ -14,7 +13,7 @@ cl.exe is a tool that controls the Microsoft C++ (MSVC) C and C++ compilers and

The compilers produce Common Object File Format (COFF) object (.obj) files. The linker produces executable (.exe) files or dynamic-link libraries (DLLs).

Note that all compiler options are case sensitive. You may use either a forward slash (`/`) or a dash (`-`) to specify a compiler option.
All compiler options are case-sensitive. You may use either a forward slash (`/`) or a dash (`-`) to specify a compiler option.

To compile without linking, use the [/c](c-compile-without-linking.md) option.

Expand Down
6 changes: 4 additions & 2 deletions docs/preprocessor/predefined-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Predefined macros"
description: "Lists and describes the Microsoft C++ compiler predefined preprocessor macros."
ms.custom: "update_every_version"
ms.date: 09/11/2020
ms.date: 12/14/2020
f1_keywords: ["_ATL_VER", "__ATOM__", "__AVX__", "__AVX2__", "__AVX512BW__", "__AVX512CD__", "__AVX512DQ__", "__AVX512F__", "__AVX512VL__", "_CHAR_UNSIGNED", "__CLR_VER", "_CONTROL_FLOW_GUARD", "__COUNTER__", "__cplusplus", "__cplusplus_cli", "__cplusplus_winrt", "_CPPRTTI", "_CPPUNWIND", "__DATE__", "_DEBUG", "_DLL", "__FILE__", "__FUNCDNAME__", "__FUNCSIG__", "__FUNCTION__", "_INTEGRAL_MAX_BITS", "_ISO_VOLATILE", "_KERNEL_MODE", "__LINE__", "_M_AMD64", "_M_ARM", "_M_ARM_ARMV7VE", "_M_ARM_FP", "_M_ARM64", "_M_CEE", "_M_CEE_PURE", "_M_CEE_SAFE", "_M_FP_EXCEPT", "_M_FP_FAST", "_M_FP_PRECISE", "_M_FP_STRICT", "_M_IX86", "_M_IX86_FP", "_M_X64", "_MANAGED", "_MFC_VER", "_MSC_BUILD", "_MSC_EXTENSIONS", "_MSC_FULL_VER", "_MSC_VER", "_MSVC_LANG", "__MSVC_RUNTIME_CHECKS", "_MT", "_NATIVE_WCHAR_T_DEFINED", "_NO_SIZED_DEALLOCATION", "_OPENMP", "_PREFAST_", "_RESUMABLE_FUNCTIONS_SUPPORTED", "_RTC_CONVERSION_CHECKS_ENABLED", "__STDC__", "__STDC_HOSTED__", "__STDC_NO_ATOMICS__", "__STDC_NO_COMPLEX__", "__STDC_NO_THREADS__", "__STDC_NO_VLA__", "__STDC_VERSION__", "__STDCPP_THREADS__", "__TIME__", "__TIMESTAMP__", "__VA_ARGS__", "_VC_NODEFAULTLIB", "_WCHAR_T_DEFINED", "_WIN32", "_WIN64", "_WINRT_DLL"]
helpviewer_keywords: ["timestamps, preprocessor macro", "cl.exe compiler, version number", "version numbers, C/C++ compiler (cl.exe)", "macros, predefined C++", "preprocessor, macros", "predefined macros", "_ATL_VER macro", "__ATOM__ macro", "__AVX__ macro", "__AVX2__ macro", "__AVX512BW__ macro", "__AVX512CD__ macro", "__AVX512DQ__ macro", "__AVX512F__ macro", "__AVX512VL__ macro", "_CHAR_UNSIGNED macro", "__CLR_VER macro", "_CONTROL_FLOW_GUARD macro", "__COUNTER__ macro", "__cplusplus macro", "__cplusplus_cli macro", "__cplusplus_winrt macro", "_CPPRTTI macro", "_CPPUNWIND macro", "__DATE__ macro", "_DEBUG macro", "_DLL macro", "__FILE__ macro", "__FUNCDNAME__ macro", "__FUNCSIG__ macro", "__FUNCTION__ macro", "_INTEGRAL_MAX_BITS macro", "_ISO_VOLATILE macro", "_KERNEL_MODE macro", "__LINE__ macro", "_M_AMD64 macro", "_M_ARM macro", "_M_ARM_ARMV7VE macro", "_M_ARM_FP macro", "_M_ARM64 macro", "_M_CEE macro", "_M_CEE_PURE macro", "_M_CEE_SAFE macro", "_M_FP_EXCEPT macro", "_M_FP_FAST macro", "_M_FP_PRECISE macro", "_M_FP_STRICT macro", "_M_IX86 macro", "_M_IX86_FP macro", "_M_X64 macro", "_MANAGED macro", "_MFC_VER macro", "_MSC_BUILD macro", "_MSC_EXTENSIONS macro", "_MSC_FULL_VER macro", "_MSC_VER macro", "_MSVC_LANG macro", "__MSVC_RUNTIME_CHECKS macro", "_MT macro", "_NATIVE_WCHAR_T_DEFINED macro", "_NO_SIZED_DEALLOCATION macro", "_OPENMP macro", "_PREFAST_ macro", "_RESUMABLE_FUNCTIONS_SUPPORTED macro", "_RTC_CONVERSION_CHECKS_ENABLED macro", "__STDC__ macro", "__STDC_HOSTED__ macro", "__STDC_NO_ATOMICS__ macro", "__STDC_NO_COMPLEX__ macro", "__STDC_NO_THREADS__ macro", "__STDC_NO_VLA__ macro", "__STDC_VERSION__ macro", "__STDCPP_THREADS__ macro", "__TIME__ macro", "__TIMESTAMP__ macro", "__VA_ARGS__ macro", "_VC_NODEFAULTLIB macro", "_WCHAR_T_DEFINED macro", "_WIN32 macro", "_WIN64 macro", "_WINRT_DLL macro", "__func__ identifier"]
ms.assetid: 1cc5f70a-a225-469c-aed0-fe766238e23f
Expand Down Expand Up @@ -286,7 +286,9 @@ MSVC supports these additional predefined macros.

- `__MSVC_RUNTIME_CHECKS` Defined as 1 when one of the [`/RTC`](../build/reference/rtc-run-time-error-checks.md) compiler options is set. Otherwise, undefined.

- `_MSVC_TRADITIONAL` Defined as 0 when the preprocessor conformance mode [`/experimental:preprocessor`](../build/reference/experimental-preprocessor.md) compiler option is set. Defined as 1 by default, or when the [`/experimental:preprocessor-`](../build/reference/experimental-preprocessor.md) compiler option is set, to indicate the traditional preprocessor is in use. The `_MSVC_TRADITIONAL` macro and [**`/experimental:preprocessor`** (Enable preprocessor conformance mode)](../build/reference/experimental-preprocessor.md) compiler option is available beginning in Visual Studio 2017 version 15.8.
- `_MSVC_TRADITIONAL`:
- Available beginning with Visual Studio 2017 version 15.8: Defined as 0 when the preprocessor conformance mode [`/experimental:preprocessor`](../build/reference/experimental-preprocessor.md) compiler option is set. Defined as 1 by default, or when the [`/experimental:preprocessor-`](../build/reference/experimental-preprocessor.md) compiler option is set, to indicate the traditional preprocessor is in use.
- Available beginning with Visual Studio 2019 version 16.5: Defined as 0 when the preprocessor conformance mode [`/Zc:preprocessor`](../build/reference/zc-preprocessor.md) compiler option is set. Defined as 1 by default, or when the `/Zc:preprocessor-` compiler option is set, to indicate the traditional preprocessor is in use (essentially, `/Zc:preprocessor` replaces the deprecated `/experimental:preprocessor`).

```cpp
#if defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL
Expand Down
2 changes: 1 addition & 1 deletion docs/preprocessor/variadic-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Variadic macros are function-like macros that contain a variable number of argum

To use variadic macros, the ellipsis may be specified as the final formal argument in a macro definition, and the replacement identifier `__VA_ARGS__` may be used in the definition to insert the extra arguments. `__VA_ARGS__` is replaced by all of the arguments that match the ellipsis, including commas between them.

The C Standard specifies that at least one argument must be passed to the ellipsis, to ensure the macro doesn't resolve to an expression with a trailing comma. The traditional Microsoft C++ implementation suppresses a trailing comma if no arguments are passed to the ellipsis. When the `/experimental:preprocessor` compiler option is set, the trailing comma is not suppressed.
The C Standard specifies that at least one argument must be passed to the ellipsis to ensure the macro doesn't resolve to an expression with a trailing comma. The traditional Microsoft C++ implementation suppresses a trailing comma if no arguments are passed to the ellipsis. When the [`/Zc:preprocessor`](../build/reference/zc-preprocessor.md) compiler option is set, the trailing comma isn't suppressed.

## Example

Expand Down