Skip to content

Commit 499e02a

Browse files
authored
Merge pull request MicrosoftDocs#4124 from corob-msft/docs/corob/cpp-docs-220222
Fix a collection of cpp-docs issues
2 parents 0668927 + 7736e24 commit 499e02a

8 files changed

Lines changed: 100 additions & 103 deletions
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
11
---
2-
description: "Learn more about: /Qpar (Auto-Parallelizer)"
3-
title: "/Qpar (Auto-Parallelizer)"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: /Qpar (Auto-parallelizer)"
3+
title: "/Qpar (Auto-parallelizer)"
4+
ms.date: 02/22/2022
55
f1_keywords: ["VC.Project.VCCLCompilerTool.EnableParallelCodeGeneration"]
66
ms.assetid: 33ecf49d-c0d5-4f34-bce3-84ff03f38918
77
---
8-
# /Qpar (Auto-Parallelizer)
8+
# `/Qpar` (Auto-parallelizer)
99

10-
Enables the [Auto-Parallelizer](../../parallel/auto-parallelization-and-auto-vectorization.md) feature of the compiler to automatically parallelize loops in your code.
10+
Enables the [Auto-parallelizer](../../parallel/auto-parallelization-and-auto-vectorization.md) feature of the compiler to automatically parallelize loops in your code.
1111

1212
## Syntax
1313

14-
```
15-
/Qpar
16-
```
14+
> **`/Qpar`**
1715
1816
## Remarks
1917

20-
When the compiler automatically parallelizes loops in code, it spreads computation across multiple processor cores. A loop is parallelized only if the compiler determines that it is legal to do so and that parallelization would improve performance.
18+
When the compiler automatically parallelizes loops in code, it spreads computation across multiple processor cores. The compiler parallelizes a loop only if it determines that it's legal to do so and that parallelization would improve performance.
2119

22-
The `#pragma loop()` directives are available to help the optimizer parallelize specific loops. For more information, see [loop](../../preprocessor/loop.md).
20+
The `#pragma loop()` directives are available to help the optimizer parallelize specific loops. For more information, see [`loop`](../../preprocessor/loop.md).
2321

24-
For information about how to enable output messages for the auto-parallelizer, see [/Qpar-report (Auto-Parallelizer Reporting Level)](qpar-report-auto-parallelizer-reporting-level.md).
22+
For information about how to enable output messages for the auto-parallelizer, see [`/Qpar-report` (Auto-parallelizer reporting level)](qpar-report-auto-parallelizer-reporting-level.md).
2523

26-
### To set the /Qpar compiler option in Visual Studio
24+
### To set the `/Qpar` compiler option in Visual Studio
2725

2826
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).
2927

30-
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
28+
1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
3129

32-
1. In the **Additional Options** box, enter *`/Qpar`*.
30+
1. Modify the **Enable Parallel Code Generation** property. Choose **OK** or **Apply** to save your changes.
3331

3432
### To set the /Qpar compiler option programmatically
3533

3634
- Use the code example in <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>.
3735

3836
## See also
3937

40-
[/Q Options (Low-Level Operations)](q-options-low-level-operations.md)<br/>
41-
[/Qpar-report (Auto-Parallelizer Reporting Level)](qpar-report-auto-parallelizer-reporting-level.md)<br/>
42-
[MSVC Compiler Options](compiler-options.md)<br/>
43-
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)<br/>
44-
[#pragma loop()](../../preprocessor/loop.md)<br/>
38+
[/Q options (Low-level operations)](q-options-low-level-operations.md)\
39+
[/Qpar-report (Auto-parallelizer reporting level)](qpar-report-auto-parallelizer-reporting-level.md)\
40+
[MSVC compiler options](compiler-options.md)\
41+
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
42+
[`#pragma loop()`](../../preprocessor/loop.md)\
4543
[Native code vectorization in Visual Studio](/archive/blogs/nativeconcurrency/auto-vectorizer-in-visual-studio-2012-overview)
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
---
2-
description: "Learn more about: /STACK (Stack Allocations)"
3-
title: "/STACK (Stack Allocations)"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: /STACK (Stack allocations)"
3+
title: "/STACK (Stack allocations)"
4+
ms.date: 02/22/2022
55
f1_keywords: ["VC.Project.VCLinkerTool.StackReserveSize", "VC.Project.VCLinkerTool.StackCommitSize", "/stack"]
66
helpviewer_keywords: ["STACK linker option", "-STACK linker option", "memory allocation, stack", "/STACK linker option", "stack, setting size"]
77
ms.assetid: 73283660-e4bd-47cc-b5ca-04c5d739034c
88
---
9-
# /STACK (Stack Allocations)
9+
# `/STACK` (Stack allocations)
1010

11-
```
12-
/STACK:reserve[,commit]
13-
```
11+
> **`/STACK:`***`reserve`*[**`,`***`commit`*]
1412
1513
## Remarks
1614

17-
The /STACK option sets the size of the stack in bytes. Use this option only when you build an .exe file.
15+
The **`/STACK`** linker option sets the size of the stack in bytes. Use this option only when you build an *`.exe`* file. The **`/STACK`** option is ignored when applied to *`.dll`* files.
1816

19-
The `reserve` value specifies the total stack allocation in virtual memory. For ARM, x86 and x64 machines, the default stack size is 1 MB.
17+
The *`reserve`* value specifies the total stack allocation in virtual memory. For ARM64, x86, and x64 machines, the default stack size is 1 MB.
2018

21-
`commit` is subject to interpretation by the operating system. In Windows WindowsRT it specifies the amount of physical memory to allocate at a time. Committed virtual memory causes space to be reserved in the paging file. A higher `commit` value saves time when the application needs more stack space, but increases the memory requirements and possibly the startup time. For ARM, x86 and x64 machines, the default commit value is 4 KB.
19+
The *`commit`* value is subject to interpretation by the operating system. In WindowsRT, it specifies the amount of physical memory to allocate at a time. Committed virtual memory causes space to be reserved in the paging file. A higher *`commit`* value saves time when the application needs more stack space, but increases the memory requirements and possibly the startup time. For ARM64, x86, and x64 machines, the default *`commit`* value is 4 KB.
2220

23-
Specify the `reserve` and `commit` values in decimal or C-language notation.
21+
Specify the *`reserve`* and *`commit`* values in decimal or C-language hexadecimal notation (use a `0x` prefix).
2422

25-
Another way to set the size of the stack is with the [STACKSIZE](stacksize.md) statement in a module-definition (.def) file. **STACKSIZE** overrides the Stack Allocations (/STACK) option if both are specified. You can change the stack size after the .exe file is built by using the [EDITBIN](editbin-reference.md) tool.
23+
Another way to set the size of the stack is with the [`STACKSIZE`](stacksize.md) statement in a module-definition (*`.def`*) file. **`STACKSIZE`** overrides the Stack Allocations (**`/STACK`**) option if both are specified. You can change the stack size after the *`.exe`* file is built by using the [`EDITBIN`](editbin-reference.md) tool.
2624

2725
### To set this linker option in the Visual Studio development environment
2826

@@ -42,5 +40,5 @@ Another way to set the size of the stack is with the [STACKSIZE](stacksize.md) s
4240

4341
## See also
4442

45-
[MSVC linker reference](linking.md)<br/>
46-
[MSVC Linker Options](linker-options.md)
43+
[MSVC linker reference](linking.md)\
44+
[MSVC linker options](linker-options.md)

docs/code-quality/clang-tidy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: Using Clang-Tidy in Visual Studio
33
description: "How to use Clang-Tidy in Visual Studio for Microsoft C++ code analysis."
4-
ms.date: 02/19/2020
4+
ms.date: 02/22/2022
55
ms.topic: "conceptual"
66
f1_keywords: ["vs.codeanalysis.clangtidy"]
77
---
88
# Using Clang-Tidy in Visual Studio
99

1010
::: moniker range="<=msvc-150"
1111

12-
Support for Clang-Tidy requires Visual Studio 2019 version 16.4 or later. To see the documentation for this version, set the Visual Studio **Version** selector control for this article to Visual Studio 2019. It's found at the top of the table of contents on this page.
12+
Support for Clang-Tidy requires Visual Studio 2019 version 16.4 or later. To see the documentation for this version, set the Visual Studio **Version** selector control for this article to Visual Studio 2019 or later. It's found at the top of the table of contents on this page.
1313

1414
::: moniker-end
1515

@@ -45,7 +45,7 @@ Clang-Tidy runs result in warnings displayed in the Error List, and as in-editor
4545

4646
## Clang-Tidy configuration
4747

48-
You can configure the checks that clang-tidy runs inside Visual Studio via the **Clang-Tidy Checks** option. This input is provided to the **`--checks`** argument of the tool. Any further configuration can be included in custom *`.clang-tidy`* files. For more information, see the [Clang-Tidy documentation on LLVM.org](https://clang.llvm.org/extra/clang-tidy/).
48+
By default, Clang-Tidy runs the `clang-analyzer-*` checks when enabled. To see the list of checks, run `clang-tidy -list-checks` in a developer command prompt. You can configure the checks that clang-tidy runs inside Visual Studio via the **Clang-Tidy Checks** option. This input is provided to the **`--checks`** argument of the tool. Any further configuration can be included in custom *`.clang-tidy`* files. For more information, see the [Clang-Tidy documentation on LLVM.org](https://clang.llvm.org/extra/clang-tidy/).
4949

5050
## See also
5151

docs/cpp/declarations-and-definitions-cpp.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Declarations and definitions (C++)"
33
title: "Declarations and definitions (C++)"
4-
ms.date: 07/23/2021
4+
ms.date: 02/22/2022
55
---
66
# Declarations and definitions (C++)
77

@@ -18,8 +18,8 @@ int main()
1818
{
1919
const double pi = 3.14; //OK
2020
int i = f(2); //OK. f is forward-declared
21-
std::string str; // OK std::string is declared in <string> header
2221
C obj; // error! C not yet declared.
22+
std::string str; // OK std::string is declared in <string> header
2323
j = 0; // error! No type specified.
2424
auto k = 0; // OK. type inferred as int by compiler.
2525
}
@@ -36,7 +36,7 @@ namespace N {
3636
3737
On line 5, the `main` function is declared. On line 7, a **`const`** variable named `pi` is declared and *initialized*. On line 8, an integer `i` is declared and initialized with the value produced by the function `f`. The name `f` is visible to the compiler because of the *forward declaration* on line 3.
3838
39-
In line 9, a variable named `obj` of type `C` is declared. However, this declaration raises an error because `C` isn't declared until later in the program, and isn't forward-declared. To fix the error, you can either move the entire *definition* of `C` before `main` or else add a forward-declaration for it. This behavior is different from other languages such as C#, in which functions and classes can be used before their point of declaration in a source file.
39+
In line 9, a variable named `obj` of type `C` is declared. However, this declaration raises an error because `C` isn't declared until later in the program, and isn't forward-declared. To fix the error, you can either move the entire *definition* of `C` before `main` or else add a forward-declaration for it. This behavior is different from other languages such as C#. In those languages, functions and classes can be used before their point of declaration in a source file.
4040
4141
In line 10, a variable named `str` of type `std::string` is declared. The name `std::string` is visible because it's introduced in the `string` [header file](header-files-cpp.md), which is merged into the source file in line 1. `std` is the namespace in which the `string` class is declared.
4242
@@ -82,25 +82,25 @@ In older versions of C++, the [`typedef`](aliases-and-typedefs-cpp.md) keyword i
8282
8383
## Static class members
8484
85-
Because static class data members are discrete variables that are shared by all objects of the class, they must be defined and initialized outside the class definition. (For more information, see [Classes](../cpp/classes-and-structs-cpp.md).)
85+
Static class data members are discrete variables that are shared by all objects of the class. Because they're shared, they must be defined and initialized outside the class definition. For more information, see [Classes](../cpp/classes-and-structs-cpp.md).
8686
8787
## extern declarations
8888
89-
A C++ program might contain more than one [compilation unit](header-files-cpp.md). To declare an entity that is defined in a separate compilation unit, use the [`extern`](extern-cpp.md) keyword. The information in the declaration is sufficient for the compiler, but if the definition of the entity can't be found in the linking step, then the linker will raise an error.
89+
A C++ program might contain more than one [compilation unit](header-files-cpp.md). To declare an entity that's defined in a separate compilation unit, use the [`extern`](extern-cpp.md) keyword. The information in the declaration is sufficient for the compiler. However, if the definition of the entity can't be found in the linking step, then the linker will raise an error.
9090
9191
## In this section
9292
93-
[Storage classes](storage-classes-cpp.md)<br/>
94-
[`const`](const-cpp.md)<br/>
95-
[`constexpr`](constexpr-cpp.md)<br/>
96-
[`extern`](extern-cpp.md)<br/>
97-
[Initializers](initializers.md)<br/>
98-
[Aliases and typedefs](aliases-and-typedefs-cpp.md)<br/>
99-
[`using` declaration](using-declaration.md)<br/>
100-
[`volatile`](volatile-cpp.md)<br/>
101-
[`decltype`](decltype-cpp.md)<br/>
102-
[Attributes in C++](attributes.md)<br/>
93+
[Storage classes](storage-classes-cpp.md)\
94+
[`const`](const-cpp.md)\
95+
[`constexpr`](constexpr-cpp.md)\
96+
[`extern`](extern-cpp.md)\
97+
[Initializers](initializers.md)\
98+
[Aliases and typedefs](aliases-and-typedefs-cpp.md)\
99+
[`using` declaration](using-declaration.md)\
100+
[`volatile`](volatile-cpp.md)\
101+
[`decltype`](decltype-cpp.md)\
102+
[Attributes in C++](attributes.md)
103103
104104
## See also
105105
106-
[Basic Concepts](../cpp/basic-concepts-cpp.md)<br/>
106+
[Basic Concepts](../cpp/basic-concepts-cpp.md)

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4251.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Compiler Warning (level 1) C4251"
33
title: "Compiler Warning (level 1) C4251"
4-
ms.date: "04/21/2020"
4+
ms.date: 02/22/2022
55
f1_keywords: ["C4251"]
66
helpviewer_keywords: ["C4251"]
77
ms.assetid: a9992038-f0c2-4fc4-a9be-4509442cbc1e
@@ -12,7 +12,7 @@ ms.assetid: a9992038-f0c2-4fc4-a9be-4509442cbc1e
1212
1313
## Remarks
1414

15-
To minimize the possibility of data corruption when exporting a class declared as [__declspec(dllexport)](../../cpp/dllexport-dllimport.md), ensure that:
15+
To minimize the possibility of data corruption when exporting a class declared as [`__declspec(dllexport)`](../../cpp/dllexport-dllimport.md), ensure that:
1616

1717
- All your static data is accessed through functions that are exported from the DLL.
1818

@@ -22,9 +22,9 @@ To minimize the possibility of data corruption when exporting a class declared a
2222

2323
- No methods of your class (whether inlined or not) can use types where the instantiation in the EXE and DLL have static data differences.
2424

25-
You can avoid issues when exporting a class from a DLL: Define your class to have virtual functions, and functions to instantiate and delete objects of the type. You can then just call virtual functions on the type.
25+
You can avoid issues when exporting a class from a DLL: Define your class to have virtual functions, a virtual destructor, and functions to instantiate and delete objects of the type. You can then just call virtual functions on the type.
2626

27-
C4251 can be ignored if your class is derived from a type in the C++ Standard Library, you're compiling a debug release (**/MTd**), and where the compiler error message refers to `_Container_base`.
27+
C4251 can be ignored if your class is derived from a type in the C++ Standard Library, you're compiling a debug release (**`/MTd`**), and where the compiler error message refers to `_Container_base`.
2828

2929
## Example
3030

0 commit comments

Comments
 (0)