Skip to content

Commit 376ef64

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#1868 from MicrosoftDocs/master637153169825427957
Fix git push error for protected CLA branch
2 parents 24b1cb6 + a930a9b commit 376ef64

27 files changed

Lines changed: 471 additions & 83 deletions

docs/build/reference/compiler-options-listed-alphabetically.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Compiler Options Listed Alphabetically"
3-
ms.date: "08/08/2019"
3+
ms.date: "01/08/2020"
44
helpviewer_keywords: ["compiler options, C++"]
55
---
66
# Compiler Options Listed Alphabetically
@@ -102,6 +102,7 @@ The following is a comprehensive alphabetical list of compiler options. For a ca
102102
|[/Qfast_transcendentals](qfast-transcendentals-force-fast-transcendentals.md)|Generates fast transcendentals.|
103103
|[/QIfist](qifist-suppress-ftol.md)|Deprecated. Suppresses `_ftol` when a conversion from a floating-point type to an integral type is required (x86 only).|
104104
|[/Qimprecise_fwaits](qimprecise-fwaits-remove-fwaits-inside-try-blocks.md)|Removes `fwait` commands inside `try` blocks.|
105+
|[/QIntel-jcc-erratum](qintel-jcc-erratum.md)|Mitigates the performance impact of the Intel JCC erratum microcode update.|
105106
|[/Qpar (Auto-Parallelizer)](qpar-auto-parallelizer.md)|Enables automatic parallelization of loops that are marked with the [#pragma loop()](../../preprocessor/loop.md) directive.|
106107
|[/Qsafe_fp_loads](qsafe-fp-loads.md)|Uses integer move instructions for floating-point values and disables certain floating point load optimizations.|
107108
|[/Qspectre](qspectre.md)|Specifies compiler generation of instructions to mitigate certain Spectre variant 1 security vulnerabilities.|

docs/build/reference/compiler-options-listed-by-category.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Compiler Options Listed by Category"
3-
ms.date: "08/08/2019"
3+
ms.date: "01/08/2020"
44
helpviewer_keywords: ["compiler options, C++"]
55
ms.assetid: c4750dcf-dba0-4229-99b6-45cdecc11729
66
---
@@ -57,6 +57,7 @@ This article contains a categorical list of compiler options. For an alphabetica
5757
|[/Qfast_transcendentals](qfast-transcendentals-force-fast-transcendentals.md)|Generates fast transcendentals.|
5858
|[/QIfist](qifist-suppress-ftol.md)|Deprecated. Suppresses the call of the helper function `_ftol` when a conversion from a floating-point type to an integral type is required. (x86 only)|
5959
|[/Qimprecise_fwaits](qimprecise-fwaits-remove-fwaits-inside-try-blocks.md)|Removes `fwait` commands inside `try` blocks.|
60+
|[/QIntel-jcc-erratum](qintel-jcc-erratum.md)|Mitigates the performance impact of the Intel JCC erratum microcode update.|
6061
|[/Qpar](qpar-auto-parallelizer.md)|Enables automatic parallelization of loops.|
6162
|[/Qpar-report](qpar-report-auto-parallelizer-reporting-level.md)|Enables reporting levels for automatic parallelization.|
6263
|[/Qsafe_fp_loads](qsafe-fp-loads.md)|Uses integer move instructions for floating-point values and disables certain floating point load optimizations.|

docs/build/reference/q-options-low-level-operations.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "/Q Options (Low-Level Operations)"
3-
ms.date: "01/23/2018"
3+
ms.date: "01/08/2020"
44
f1_keywords: ["/q"]
55
helpviewer_keywords: ["Q compiler option [C++]", "-Q compiler option [C++]", "/Q compiler option [C++]"]
66
---
@@ -14,6 +14,8 @@ You can use the **/Q** compiler options to perform the following low-level compi
1414

1515
- [/Qimprecise_fwaits (Remove fwaits Inside Try Blocks)](qimprecise-fwaits-remove-fwaits-inside-try-blocks.md): Removes `fwait` commands inside `try` blocks.
1616

17+
- [/QIntel-jcc-erratum](qintel-jcc-erratum.md): Mitigates the performance impact caused by the Intel Jump Conditional Code (JCC) erratum microcode update.
18+
1719
- [/Qpar (Auto-Parallelizer)](qpar-auto-parallelizer.md): Enables automatic parallelization of loops that are marked with the [#pragma loop()](../../preprocessor/loop.md) directive.
1820

1921
- [/Qpar-report (Auto-Parallelizer Reporting Level)](qpar-report-auto-parallelizer-reporting-level.md): Enables reporting levels for automatic parallelization.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: "/QIntel-jcc-erratum"
3+
description: "Describes the Microsoft C/C++ compiler (MSVC) /QIntel-jcc-erratum option."
4+
ms.date: "01/07/2020"
5+
f1_keywords: ["QIntel-jcc-erratum"]
6+
helpviewer_keywords: ["/QIntel-jcc-erratum", "-QIntel-jcc-erratum"]
7+
---
8+
# /QIntel-jcc-erratum
9+
10+
::: moniker range="<=vs-2017"
11+
12+
The **/QIntel-jcc-erratum** option is available in Visual Studio 2019 version 16.5 and later.
13+
14+
::: moniker-end
15+
16+
::: moniker range=">=vs-2019"
17+
18+
Specifies that the compiler generates instructions to mitigate the performance impact caused by the Intel Jump Conditional Code (JCC) erratum microcode update in certain Intel processors.
19+
20+
## Syntax
21+
22+
> **/QIntel-jcc-erratum**
23+
24+
## Remarks
25+
26+
Under **/QIntel-jcc-erratum**, the compiler detects jump and macro-fused jump instructions that cross or end on a 32-byte boundary. It aligns these instructions to the boundary. This change mitigates the performance impact of microcode updates that prevent the JCC erratum in certain Intel processors. For more information about the erratum, see [Mitigations for Jump Conditional Code Erratum](https://www.intel.com/content/dam/support/us/en/documents/processors/mitigations-jump-conditional-code-erratum.pdf) on the Intel website.
27+
28+
The **/QIntel-jcc-erratum** option is available in Visual Studio 2019 version 16.5 and later. This option is only available in compilers that target x86 and x64. The option isn't available in compilers that target ARM processors.
29+
30+
The **/QIntel-jcc-erratum** option is off by default, and works only in optimized builds. This option can increase code size.
31+
32+
**/QIntel-jcc-erratum** is incompatible with [/clr](clr-common-language-runtime-compilation.md).
33+
34+
### To set this compiler option in the Visual Studio development environment
35+
36+
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
37+
38+
1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
39+
40+
1. Select a value for the **Enable Intel JCC Erratum Mitigation** property. Choose **OK** to apply the change.
41+
42+
### To set this compiler option programmatically
43+
44+
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>.
45+
46+
## See also
47+
48+
[/Q options (Low-level operations)](q-options-low-level-operations.md)\
49+
[MSVC compiler options](compiler-options.md)\
50+
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
51+
52+
::: moniker-end

docs/build/reference/zc-inline-remove-unreferenced-comdat.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ ms.assetid: a4c94224-1d73-4bea-a9d5-4fa73dc924df
77
---
88
# /Zc:inline (Remove unreferenced COMDAT)
99

10-
Removes unreferenced functions or data that are COMDATs or only have internal linkage. When **/Zc:inline** is specified, the compiler requires that translation units that use inline data or inline functions must also include the definitions for the data or functions.
10+
Removes unreferenced data or functions that are COMDATs, or that only have internal linkage. Under **/Zc:inline**, the compiler specifies that translation units with inline data or functions must also include their definitions.
1111

1212
## Syntax
1313

1414
> **/Zc:inline**[**-**]
1515
1616
## Remarks
1717

18-
When **/Zc:inline** is specified, the compiler does not emit symbol information for unreferenced COMDAT functions or data, or for functions or data that have internal linkage only. This optimization simplifies some of the work performed by the linker in release builds or when the linker option [/OPT:REF](opt-optimizations.md) is specified. When the compiler performs this optimization, it can significantly reduce .obj file size and improve linker speeds. This compiler option is not enabled when optimizations are disabled ([/Od](od-disable-debug.md)) or when [/GL (Whole Program Optimization)](gl-whole-program-optimization.md) is specified.
18+
When **/Zc:inline** is specified, the compiler doesn't emit symbol information for unreferenced COMDAT functions or data. Or, for data or functions that have internal linkage only. This optimization simplifies some of the work the linker does in release builds, or when you specify the [/OPT:REF](opt-optimizations.md) linker option. This compiler optimization can significantly reduce .obj file size and improve linker speeds. The compiler option isn't enabled when you disable optimizations ([/Od](od-disable-debug.md)). Or, when you specify [/GL (Whole Program Optimization)](gl-whole-program-optimization.md).
1919

20-
By default, this option is off (**/Zc:inline-**) in command-line builds. The [/permissive-](permissive-standards-conformance.md) option does not enable **/Zc:inline**. In MSBuild projects, the option is set by the **Configuration Properties** > **C/C++** > **Language** > **Remove unreferenced code and data** property, which is set to **Yes** by default.
20+
By default, this option is off (**/Zc:inline-**) in command-line builds. The [/permissive-](permissive-standards-conformance.md) option doesn't enable **/Zc:inline**. In MSBuild projects, the option is set by the **Configuration Properties** > **C/C++** > **Language** > **Remove unreferenced code and data** property, which is set to **Yes** by default.
2121

2222
If **/Zc:inline** is specified, the compiler enforces the C++11 requirement that all functions declared `inline` must have a definition available in the same translation unit if they are used. When the option is not specified, the Microsoft compiler allows non-conformant code that invokes functions declared `inline` even if no definition is visible. For more information, see the C++11 standard, in section 3.2 and section 7.1.2. This compiler option was introduced in Visual Studio 2013 Update 2.
2323

@@ -59,7 +59,7 @@ void Example::normal_call() {
5959
// Compile by using: cl /W4 /EHsc /O2 zcinline.cpp example.cpp
6060
#include "example.h"
6161

62-
void main() {
62+
int main() {
6363
Example example;
6464
example.inline_call(); // normal call when definition unavailable
6565
}
@@ -101,7 +101,7 @@ void Example2::normal_call() {
101101
// Compile by using: cl /W4 /EHsc /O2 zcinline2.cpp example2.cpp
102102
#include "example2.h"
103103

104-
void main() {
104+
int main() {
105105
Example2 example2;
106106
example2.inline_call(); // normal call when definition unavailable
107107
}

docs/build/reference/zc-referencebinding-enforce-reference-binding-rules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ ms.assetid: 0c6cfaac-9c2a-41a3-aa94-64ca8ef261fc
77
---
88
# /Zc:referenceBinding (Enforce reference binding rules)
99

10-
When the **/Zc:referenceBinding** option is specified, the compiler does not allow a non-const lvalue reference to bind to a temporary.
10+
When the **/Zc:referenceBinding** option is specified, the compiler doesn't allow a non-const lvalue reference to bind to a temporary.
1111

1212
## Syntax
1313

1414
> **/Zc:referenceBinding**[**-**]
1515
1616
## Remarks
1717

18-
If **/Zc:referenceBinding** is specified, the compiler follows section 8.5.3 of the C++11 standard and does not allow expressions that bind a user-defined type temporary to a non-const lvalue reference. By default, or if **/Zc:referenceBinding-** is specified, the compiler allows such expressions as a Microsoft extension, but a level 4 warning is issued. For code security, portability and conformance, we recommend that you use **/Zc:referenceBinding**.
18+
If **/Zc:referenceBinding** is specified, the compiler follows section 8.5.3 of the C++11 standard: It doesn't allow expressions that bind a user-defined type temporary to a non-const lvalue reference. By default, or if **/Zc:referenceBinding-** is specified, the compiler allows such expressions as a Microsoft extension, but a level 4 warning is issued. For code security, portability and conformance, we recommend you use **/Zc:referenceBinding**.
1919

2020
The **/Zc:referenceBinding** option is off by default. The [/permissive-](permissive-standards-conformance.md) compiler option implicitly sets this option, but it can be overridden by using **/Zc:referenceBinding-**.
2121

@@ -35,7 +35,7 @@ S g() {
3535
return S{};
3636
}
3737

38-
void main() {
38+
int main() {
3939
S& s = g(); // warning C4239 at /W4
4040
const S& cs = g(); // okay, bound to const ref
4141
f(g()); // Extension: error C2664 only if /Zc:referenceBinding

docs/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Before you can build a C or C++ program on the command line, you must verify tha
6868
```cpp
6969
#include <iostream>
7070
using namespace std;
71-
void main()
71+
int main()
7272
{
7373
cout << "Hello, world, from Visual C++!" << endl;
7474
}

docs/c-runtime-library/reference/wcsrtombs-s.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The **wcsrtombs_s** function is multithread safe as long as no function in the c
114114

115115
#define MB_BUFFER_SIZE 100
116116

117-
void main()
117+
int main()
118118
{
119119
const wchar_t wcString[] =
120120
{L"Every good boy does fine."};

docs/cpp/attributes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Attributes represent a standardized alternative to vendor-specific extensions su
5757
- `[[gsl::suppress(rules)]]` This Microsoft-specific attribute is used for suppressing warnings from checkers that enforce [Guidelines Support Library (GSL)](https://github.com/Microsoft/GSL) rules in code. For example, consider this code snippet:
5858
5959
```cpp
60-
void main()
60+
int main()
6161
{
6262
int arr[10]; // GSL warning 26494 will be fired
6363
int* p = arr; // GSL warning 26485 will be fired
@@ -77,4 +77,5 @@ Attributes represent a standardized alternative to vendor-specific extensions su
7777
7878
- 26481 (Bounds Rule 1: Don't use pointer arithmetic. Use span instead.)
7979
80-
The first two warnings fire when you compile this code with the CppCoreCheck code analysis tool installed and activated. But the third warning doesn't fire because of the attribute. You can suppress the entire bounds profile by writing [[gsl::suppress(bounds)]] without including a specific rule number. The C++ Core Guidelines are designed to help you write better and safer code. The suppress attribute makes it easy to turn off the warnings when they are not wanted.
80+
The first two warnings fire when you compile this code with the CppCoreCheck code analysis tool installed and activated. But the third warning doesn't fire because of the attribute. You can suppress the entire bounds profile by writing [[gsl::suppress(bounds)]] without including a specific rule number. The C++ Core Guidelines are designed to help you write better and safer code. The suppress attribute makes it easy to turn off the warnings when they are not wanted.
81+

docs/cpp/import-export-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Non-exported names are not visible to code that imports the module:
4848

4949
import module ModuleA;
5050

51-
void main() {
51+
int main() {
5252
Bar::f(); // OK
5353
Bar::d(); // OK
5454
Bar::internal_f(); // Ill-formed: error C2065: 'internal_f': undeclared identifier

0 commit comments

Comments
 (0)