You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enables generation of EH Continuation (EHCONT) metadata by the compiler.
11
11
@@ -25,7 +25,7 @@ When shadow stacks are available to prevent ROP attacks, attackers move on to us
25
25
26
26
`RtlRestoreContext` and `NtContinue` are used during Structured Exception Handling (SEH) exception unwinding to unwind to the target frame that contains the **`__except`** block. The instruction pointer of the **`__except`** block isn't expected to be on the shadow stack, because it would fail instruction pointer validation. The **`/guard:ehcont`** compiler switch generates an "EH Continuation Table". It contains a sorted list of the RVAs of all valid exception handling continuation targets in the binary. `NtContinue` first checks the shadow stack for the user-supplied instruction pointer, and if the instruction pointer isn't found there, it proceeds to check the EH Continuation Table from the binary that contains the instruction pointer. If the containing binary wasn't compiled with the table, then for compatibility with legacy binaries, `NtContinue` is allowed to continue. It's important to distinguish between legacy binaries that have no EHCONT data, and binaries containing EHCONT data but no table entries. The former allow all addresses inside the binary as valid continuation targets. The latter don't allow any address inside the binary as a valid continuation target.
27
27
28
-
The **`/guard:ehcont`** option must be passed to both the compiler and linker to generate EH continuation target RVAs for a binary. If your binary is built by using a single `cl` command, the compiler passes the option to the linker. The compiler also passes the [**`/guard:cf`**](guard-enable-control-flow-guard.md) option to the linker. If you compile and link separately, these options must be set on both the compiler and linker commands.
28
+
The **`/guard:ehcont`** option must be passed to both the compiler and linker to generate EH continuation target RVAs for a binary. If your binary is built by using a single `cl` command, the compiler passes the option to the linker. The compiler also passes the [`/guard:cf`](guard-enable-control-flow-guard.md) option to the linker. If you compile and link separately, these options must be set on both the compiler and linker commands.
29
29
30
30
You can link code compiled by using **`/guard:ehcont`** to libraries and object files compiled without it. The linker returns a fatal error in any of these scenarios:
@@ -12,26 +12,29 @@ Specify standards conformance mode to the compiler. Use this option to help you
12
12
13
13
## Syntax
14
14
15
-
> **`/permissive-`**
15
+
> **`/permissive-`**\
16
+
> **`/permissive`**
16
17
17
18
## Remarks
18
19
19
-
This option is supported in Visual Studio 2017 and later.
20
+
The **`/permissive-`**option is supported in Visual Studio 2017 and later. **`/permissive`** is supported in Visual Studio 2019 version 16.8 and later.
20
21
21
-
You can use the **`/permissive-`** compiler option to specify standards-conforming compiler behavior. This option disables permissive behaviors, and sets the [**`/Zc`**](zc-conformance.md) compiler options for strict conformance. In the IDE, this option also makes the IntelliSense engine underline non-conforming code.
22
+
You can use the **`/permissive-`** compiler option to specify standards-conforming compiler behavior. This option disables permissive behaviors, and sets the [`/Zc`](zc-conformance.md) compiler options for strict conformance. In the IDE, this option also makes the IntelliSense engine underline non-conforming code.
23
+
24
+
The **`/permissive-`** option uses the conformance support in the current compiler version to determine which language constructs are non-conforming. The option doesn't determine if your code conforms to a specific version of the C++ standard. To enable all implemented compiler support for the latest draft standard, use the [`/std:c++latest`](std-specify-language-standard-version.md) option. To restrict the compiler support to the currently implemented C++17 standard, use the [`/std:c++17`](std-specify-language-standard-version.md) option. To restrict the compiler support to more closely match the C++14 standard, use the [`/std:c++14`](std-specify-language-standard-version.md) option, which is the default.
25
+
26
+
Starting in Visual Studio 2019 version 16.8, the **`/std:c++latest`** option implicitly sets the **`/permissive-`** option. It's required for C++20 Modules support. Perhaps your code doesn't need modules support but requires other features enabled under **`/std:c++latest`**. You can explicitly enable Microsoft extension support by using the **`/permissive`** option without the trailing dash.
22
27
23
28
By default, the **`/permissive-`** option is set in new projects created by Visual Studio 2017 version 15.5 and later versions. It's not set by default in earlier versions. When the option is set, the compiler generates diagnostic errors or warnings when non-standard language constructs are detected in your code. These constructs include some common bugs in pre-C++11 code.
24
29
25
30
The **`/permissive-`** option is compatible with almost all of the header files from the latest Windows Kits, such as the Software Development Kit (SDK) or Windows Driver Kit (WDK), starting in the Windows Fall Creators SDK (10.0.16299.0). Older versions of the SDK may fail to compile under **`/permissive-`** for various source code conformance reasons. The compiler and SDKs ship on different release timelines, so there are some remaining issues. For specific header file issues, see [Windows header issues](#windows-header-issues) below.
26
31
27
-
The **`/permissive-`** option sets the [**`/Zc:referenceBinding`**](zc-referencebinding-enforce-reference-binding-rules.md), [**`/Zc:strictStrings`**](zc-strictstrings-disable-string-literal-type-conversion.md), and [**`/Zc:rvalueCast`**](zc-rvaluecast-enforce-type-conversion-rules.md) options to conforming behavior. These options defaults to non-conforming behavior. You can pass specific **`/Zc`** options after **`/permissive-`** on the command line to override this behavior.
32
+
The **`/permissive-`** option sets the [`/Zc:referenceBinding`](zc-referencebinding-enforce-reference-binding-rules.md), [`/Zc:strictStrings`](zc-strictstrings-disable-string-literal-type-conversion.md), and [`/Zc:rvalueCast`](zc-rvaluecast-enforce-type-conversion-rules.md) options to conforming behavior. These options defaults to non-conforming behavior. You can pass specific **`/Zc`** options after **`/permissive-`** on the command line to override this behavior.
28
33
29
-
In versions of the compiler beginning in Visual Studio 2017 version 15.3, the **`/permissive-`** option sets the [**`/Zc:ternary`**](zc-ternary.md) option. The compiler also implements more of the requirements for two-phase name look-up. When the **`/permissive-`** option is set, the compiler parses function and class template definitions, and identifies dependent and non-dependent names used in the templates. In this release, only name dependency analysis is performed.
34
+
In versions of the compiler beginning in Visual Studio 2017 version 15.3, the **`/permissive-`** option sets the [`/Zc:ternary`](zc-ternary.md) option. The compiler also implements more of the requirements for two-phase name look-up. When the **`/permissive-`** option is set, the compiler parses function and class template definitions, and identifies dependent and non-dependent names used in the templates. In this release, only name dependency analysis is performed.
30
35
31
36
Environment-specific extensions and language areas that the standard leaves up to the implementation are not affected by **`/permissive-`**. For example, the Microsoft-specific **`__declspec`**, calling convention and structured exception handling keywords, and compiler-specific pragma directives or attributes are not flagged by the compiler in **`/permissive-`** mode.
32
37
33
-
The **`/permissive-`** option uses the conformance support in the current compiler version to determine which language constructs are non-conforming. The option doesn't determine if your code conforms to a specific version of the C++ standard. To enable all implemented compiler support for the latest draft standard, use the [**`/std:c++latest`**](std-specify-language-standard-version.md) option. To restrict the compiler support to the currently implemented C++17 standard, use the [**`/std:c++17`**](std-specify-language-standard-version.md) option. To restrict the compiler support to more closely match the C++14 standard, use the [**`/std:c++14`**](std-specify-language-standard-version.md) option, which is the default.
34
-
35
38
Not all C++11, C++14, or C++17 standards-conforming code is supported by the MSVC compiler in all versions of Visual Studio 2017. Depending on the version of Visual Studio, the **`/permissive-`** option may not detect issues in some aspects of two-phase name lookup, binding a non-const reference to a temporary, treating copy init as direct init, allowing multiple user-defined conversions in initialization, or alternative tokens for logical operators, and other non-supported conformance areas. For more information about conformance issues in Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md). To get the most out of **`/permissive-`**, update Visual Studio to the latest version.
36
39
37
40
### How to fix your code
@@ -414,7 +417,7 @@ These issues are specific to User Mode headers in the Windows Fall Creators Upda
The forward declaration of unscoped enum is a Microsoft extension. To address this issue, compile files that include cellularapi_oem.h without the **`/permissive-`** option, or use the [**`/wd`**](compiler-option-warning-level.md) option to silence warning C4471.
420
+
The forward declaration of unscoped enum is a Microsoft extension. To address this issue, compile files that include cellularapi_oem.h without the **`/permissive-`** option, or use the [`/wd`](compiler-option-warning-level.md) option to silence warning C4471.
@@ -15,9 +16,9 @@ The C++17 standard makes `throw()` an alias for **`noexcept`**, removes `throw(`
15
16
16
17
## Remarks
17
18
18
-
When the **`/Zc:noexceptTypes`** option is specified, the compiler conforms to the C++17 standard and treats [**`throw()`**](../../cpp/exception-specifications-throw-cpp.md) as an alias for [**`noexcept`**](../../cpp/noexcept-cpp.md), removes `throw(`*`type-list`*`)` and `throw(...)`, and allows certain types to include **`noexcept`**. The **`/Zc:noexceptTypes`** option is only available when [**`/std:c++17`**](std-specify-language-standard-version.md) or [**`/std:c++latest`**](std-specify-language-standard-version.md) is enabled. **`/Zc:noexceptTypes`** is enabled by default to conform to the ISO C++17 standard. The [**`/permissive-`**](permissive-standards-conformance.md) option doesn't affect **`/Zc:noexceptTypes`**. Turn off this option by specifying **`/Zc:noexceptTypes-`** to revert to the C++14 behavior of **`noexcept`** when **`/std:c++17`** or **`/std:c++latest`** is specified.
19
+
When the **`/Zc:noexceptTypes`** option is specified, the compiler conforms to the C++17 standard and treats [`throw()`](../../cpp/exception-specifications-throw-cpp.md) as an alias for [`noexcept`](../../cpp/noexcept-cpp.md), removes `throw(`*`type-list`*`)` and `throw(...)`, and allows certain types to include **`noexcept`**. The **`/Zc:noexceptTypes`** option is only available when [`/std:c++17`](std-specify-language-standard-version.md) or [`/std:c++latest`](std-specify-language-standard-version.md) is enabled. **`/Zc:noexceptTypes`** is enabled by default to conform to the ISO C++17 standard. The [`/permissive-`](permissive-standards-conformance.md) option doesn't affect **`/Zc:noexceptTypes`**. Turn off this option by specifying **`/Zc:noexceptTypes-`** to revert to the C++14 behavior of **`noexcept`** when **`/std:c++17`** or **`/std:c++latest`** is specified.
19
20
20
-
Beginning in Visual Studio 2017 version 15.5, the C++ compiler diagnoses more mismatched exception specifications in declarations in C++17 mode, or when you specify the [**`/permissive-`**](permissive-standards-conformance.md) option.
21
+
Beginning in Visual Studio 2017 version 15.5, the C++ compiler diagnoses more mismatched exception specifications in declarations in C++17 mode, or when you specify the [`/permissive-`](permissive-standards-conformance.md) option.
21
22
22
23
This sample shows how declarations with an exception specifier behave when the **`/Zc:noexceptTypes`** option is set or disabled. To show the behavior when set, compile by using `cl /EHsc /W4 noexceptTypes.cpp`. To show the behavior when disabled, compile by using `cl /EHsc /W4 /Zc:noexceptTypes- noexceptTypes.cpp`.
23
24
@@ -71,6 +72,6 @@ For more information about conformance issues in Visual C++, see [Nonstandard Be
Copy file name to clipboardExpand all lines: docs/cpp/thiscall.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
---
2
2
title: "__thiscall"
3
+
description: "Learn about the Microsoft-specific __thiscall calling convention for x86 class member functions in Microsoft C++."
3
4
ms.date: "05/22/2020"
4
5
f1_keywords: ["__thiscall", "__thiscall_cpp"]
5
6
helpviewer_keywords: ["__thiscall keyword [C++]"]
@@ -15,7 +16,7 @@ On ARM, ARM64, and x64 machines, **`__thiscall`** is accepted and ignored by the
15
16
16
17
One reason to use **`__thiscall`** is in classes whose member functions use **`__clrcall`** by default. In that case, you can use **`__thiscall`** to make individual member functions callable from native code.
17
18
18
-
When compiling with [**`/clr:pure`**](../build/reference/clr-common-language-runtime-compilation.md), all functions and function pointers are **`__clrcall`** unless specified otherwise. The **`/clr:pure`** and **`/clr:safe`** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
19
+
When compiling with [`/clr:pure`](../build/reference/clr-common-language-runtime-compilation.md), all functions and function pointers are **`__clrcall`** unless specified otherwise. The **`/clr:pure`** and **`/clr:safe`** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
19
20
20
21
`vararg` member functions use the **`__cdecl`** calling convention. All function arguments are pushed on the stack, with the **`this`** pointer placed on the stack last.
0 commit comments