Skip to content

Commit 87051bf

Browse files
authored
Merge pull request #4833 from MicrosoftDocs/main
3/02 AM Publish
2 parents 0737c4d + 01c0454 commit 87051bf

26 files changed

+344
-104
lines changed

docs/build-insights/index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ metadata:
66
title: C++ Build Insights
77
description: Learn how to use C++ Build Insights to analyze and optimize your builds.
88
ms.topic: landing-page
9-
author: corob-msft
10-
ms.author: corob
9+
author: tylermsft
10+
ms.author: twhitney
1111
ms.date: 05/26/2020
1212
ms.custom: intro-landing-hub
1313

docs/build/building-on-the-command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ When used with no arguments, *`vcvarsall.bat`* configures the environment variab
147147

148148
### `vcvarsall` syntax
149149

150-
> **`vcvarsall.bat`** [*`architecture`*] [*`platform_type`*] [*`winsdk_version`*] [**`-vcvars_ver=`**_`vcversion`_] [*`spectre_mode`*]
150+
> **`vcvarsall.bat`** [*`architecture`*] [*`platform_type`*] [*`winsdk_version`*] [**`-vcvars_ver=`***`vcversion`*] [*`spectre_mode`*]
151151
152152
*`architecture`*<br/>
153153
This optional argument specifies the host and target architecture to use. If *architecture* isn't specified, the default build environment is used. These arguments are supported:

docs/build/reference/clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ ms.topic: "reference"
66
f1_keywords: ["VC.Project.VCLinkerTool.CLRUnmanagedCodeCheck", "/CLRUNMANAGEDCODECHECK"]
77
helpviewer_keywords: ["-CLRUNMANAGEDCODECHECK linker option", "/CLRUNMANAGEDCODECHECK linker option"]
88
ms.assetid: 73abc426-dab0-45e2-be85-0f9a14206cc2
9-
author: "corob-msft"
10-
ms.author: "corob"
9+
author: "tylermsft"
10+
ms.author: "twhitney"
1111
---
1212
# `/CLRUNMANAGEDCODECHECK` (Remove SuppressUnmanagedCodeSecurityAttribute)
1313

docs/build/reference/scandependencies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
title: "/scanDependencies (List module and header unit dependencies per Standard)"
33
description: "Reference guide to the /scanDependencies compiler option in Microsoft C++."
44
ms.date: 09/21/2022
5-
author: "corob-msft"
6-
ms.author: "corob"
5+
author: "tylermsft"
6+
ms.author: "twhitney"
77
f1_keywords: ["/scanDependencies"]
88
helpviewer_keywords: ["/scanDependencies compiler option", "/scanDependencies"]
99
---

docs/cross-platform/index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ metadata:
66
title: Mobile development with C++ documentation
77
description: Create native C++ apps for iOS, Android, and Windows devices with Visual Studio.
88
ms.topic: landing-page
9-
author: corob-msft
10-
ms.author: corob
9+
author: tylermsft
10+
ms.author: twhitney
1111
ms.date: 05/26/2020
1212
ms.custom: intro-landing-hub
1313

docs/docfx.json

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -154,78 +154,78 @@
154154
"windows/**.md": "cpp-windows"
155155
},
156156
"author": {
157-
"index.md": "corob-msft",
158-
"assembler/**.md": "corob-msft",
159-
"attributes/**.md": "corob-msft",
157+
"index.md": "tylermsft",
158+
"assembler/**.md": "tylermsft",
159+
"attributes/**.md": "tylermsft",
160160
"atl/**.md": "tylermsft",
161161
"atl-mfc-shared/**.md": "tylermsft",
162-
"build/**.md": "corob-msft",
162+
"build/**.md": "tylermsft",
163163
"build-insights/**.md": "kevcadieux",
164-
"c-language/**.md": "corob-msft",
164+
"c-language/**.md": "tylermsft",
165165
"c-runtime-library/**.md": "tylermsft",
166-
"cloud/**.md": "corob-msft",
167-
"code-quality/**.md": "corob-msft",
168-
"cpp/**.md": "corob-msft",
169-
"cppcx/**.md": "corob-msft",
170-
"cross-platform/**.md": "corob-msft",
171-
"data/**.md": "corob-msft",
166+
"cloud/**.md": "tylermsft",
167+
"code-quality/**.md": "tylermsft",
168+
"cpp/**.md": "tylermsft",
169+
"cppcx/**.md": "tylermsft",
170+
"cross-platform/**.md": "tylermsft",
171+
"data/**.md": "tylermsft",
172172
"dotnet/**.md": "tylermsft",
173-
"error-messages/**.md": "corob-msft",
174-
"extensions/**.md": "corob-msft",
175-
"get-started/**.md": "corob-msft",
176-
"ide/**.md": "corob-msft",
177-
"intrinsics/**.md": "corob-msft",
173+
"error-messages/**.md": "tylermsft",
174+
"extensions/**.md": "tylermsft",
175+
"get-started/**.md": "tylermsft",
176+
"ide/**.md": "tylermsft",
177+
"intrinsics/**.md": "tylermsft",
178178
"linux/**.md": "tylermsft",
179179
"mfc/**.md": "tylermsft",
180-
"overview/**.md": "corob-msft",
180+
"overview/**.md": "tylermsft",
181181
"parallel/amp/**.md": "tylermsft",
182182
"parallel/concrt/**.md": "tylermsft",
183183
"parallel/**.md": "tylermsft",
184-
"porting/**.md": "corob-msft",
185-
"preprocessor/**.md": "corob-msft",
184+
"porting/**.md": "tylermsft",
185+
"preprocessor/**.md": "tylermsft",
186186
"safeint/**.md": "tylermsft",
187-
"sanitizers/**.md": "corob-msft",
188-
"security/**.md": "corob-msft",
187+
"sanitizers/**.md": "tylermsft",
188+
"security/**.md": "tylermsft",
189189
"standard-library/**.md": "tylermsft",
190190
"text/**.md": "tylermsft",
191-
"windows/**.md": "corob-msft"
191+
"windows/**.md": "tylermsft"
192192
},
193193
"ms.author": {
194-
"index.md": "corob",
195-
"assembler/**.md": "corob",
194+
"index.md": "twhitney",
195+
"assembler/**.md": "twhitney",
196196
"atl/**.md": "twhitney",
197197
"atl-mfc-shared/**.md": "twhitney",
198-
"attributes/**.md": "corob",
199-
"build/**.md": "corob",
198+
"attributes/**.md": "twhitney",
199+
"build/**.md": "twhitney",
200200
"build-insights/**.md": "kevca",
201-
"c-language/**.md": "corob",
201+
"c-language/**.md": "twhitney",
202202
"c-runtime-library/**.md": "twhitney",
203-
"cloud/**.md": "corob",
204-
"code-quality/**.md": "corob",
205-
"cpp/**.md": "corob",
206-
"cppcx/**.md": "corob",
207-
"cross-platform/**.md": "corob",
208-
"data/**.md": "corob",
203+
"cloud/**.md": "twhitney",
204+
"code-quality/**.md": "twhitney",
205+
"cpp/**.md": "twhitney",
206+
"cppcx/**.md": "twhitney",
207+
"cross-platform/**.md": "twhitney",
208+
"data/**.md": "twhitney",
209209
"dotnet/**.md": "twhitney",
210-
"error-messages/**.md": "corob",
211-
"extensions/**.md": "corob",
212-
"get-started/**.md": "corob",
213-
"ide/**.md": "corob",
214-
"intrinsics/**.md": "corob",
210+
"error-messages/**.md": "twhitney",
211+
"extensions/**.md": "twhitney",
212+
"get-started/**.md": "twhitney",
213+
"ide/**.md": "twhitney",
214+
"intrinsics/**.md": "twhitney",
215215
"linux/**.md": "twhitney",
216216
"mfc/**.md": "twhitney",
217-
"overview/**.md": "corob",
217+
"overview/**.md": "twhitney",
218218
"parallel/amp/**.md": "twhitney",
219219
"parallel/concrt/**.md": "twhitney",
220220
"parallel/**.md": "twhitney",
221-
"porting/**.md": "corob",
222-
"preprocessor/**.md": "corob",
221+
"porting/**.md": "twhitney",
222+
"preprocessor/**.md": "twhitney",
223223
"safeint/**.md": "twhitney",
224-
"sanitizers/**.md": "corob",
225-
"security/**.md": "corob",
224+
"sanitizers/**.md": "twhitney",
225+
"security/**.md": "twhitney",
226226
"standard-library/**.md": "twhitney",
227227
"text/**.md": "twhitney",
228-
"windows/**.md": "corob"
228+
"windows/**.md": "twhitney"
229229
}
230230
},
231231
"template": [],

docs/embedded/serial-monitor.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The Serial Monitor allows users to configure, monitor, and communicate with seri
1919
## Capabilities
2020

2121
- **Monitor a serial port**: Choose the **Start Monitoring** or **Stop Monitoring** button to control whether to monitor data coming from the port.
22-
- **Send data to a serial port**: Enter text into the text field at the bottom of the view. Use the **Enter** key or choose the **Send Message** button to send the data.
22+
- **Send data to a serial port**: Enter text into the text field at the bottom of the view. Use the **Enter** key or choose the **Send Message** arrow button to send the data.
2323
- **Clear the Serial Monitor output**: Choose the **Clear Output** button to clear the incoming data text field.
2424
- **Send preset control signals**: Use the split-button next to the input field to send preset control signals (Ctrl+C, Ctrl+D, Ctrl+X, and Ctrl+Z).
2525
- **Configure Serial Monitor and port connection settings**: See the following table to learn about the settings that the Serial Monitor provides.
@@ -50,7 +50,7 @@ The Serial Monitor allows users to configure, monitor, and communicate with seri
5050
- **Toggle the serial monitor mode**: Choose **Serial** or **TCP** from the **Monitor Mode** dropdown.
5151
- **Monitor a serial/tcp port**: Choose the **Start Monitoring** or **Stop Monitoring** button to control whether to monitor data coming from the port.
5252
- **Monitor multiple serial/tcp ports at a time**: Press the **Open an additional Monitor** button to open another monitor.
53-
- **Send data to a serial/tcp port**: Enter text into the text field at the bottom of the view. Use the **Enter** key or choose the **Send Message** button to send the data.
53+
- **Send data to a serial/tcp port**: Enter text into the text field at the bottom of the view. Use the **Enter** key or choose the **Send Message** arrow button to send the data. When sending hex or binary data, bytes are automatically separated by spaces.
5454
- **Clear the Serial Monitor output**: Choose the **Clear Output** button to clear the incoming data text field.
5555
- **Send preset control signals**: Use the split-button next to the input field to send preset control signals (Ctrl+C, Ctrl+D, Ctrl+X, and Ctrl+Z).
5656
- **Configure Serial Monitor and connection settings**: See the following table to learn about the settings that the Serial Monitor provides.
@@ -66,9 +66,12 @@ The Serial Monitor allows users to configure, monitor, and communicate with seri
6666
| **Host** | Name of your host address | Use the **Host** text box to enter your host name in **TCP** mode | Any string that matches a valid host |
6767
| **Port** | The port number of your address | Use the **Port** text box in **TCP** mode | Any valid TCP port |
6868
| **Line Ending** | The line ending to use in messages sent to the connected device | Use the **Line Ending** dropdown in **Serial** mode | None, LF, CR, CRLF |
69+
| **DTR** | Allows the DTR COM output line to be manually set | Use the **DTR** checkbox | True/False |
70+
| **RTS** | Allows the RTS COM output line to be manually set | Use the **RTS** checkbox | True/False |
6971
| **Timestamp** | Adds timestamps to the output of data received from the connected port | Use the **timestamp** toggle button | On/Off |
7072
| **Autoscroll** | Whether to auto-scroll new content that comes from the connected port | Use the **autoscroll** toggle button | On/Off |
7173
| **Automatic Reconnection** | Allows for automatic reconnection and monitoring of disconnected selected ports | Use the **automatic reconnection** toggle button | On/Off|
74+
| **Message Echoing** | Allows the ability to echo/not echo messages you send | Use the **message echoing** toggle button | On/Off |
7275
| **Message Encoding** | Can select type of encoding for messages sent to serial port | Use the **message encoding** dropdown | Text (utf8), Hex, Binary |
7376
| **Data bits** | Can select how many data bits are used for the serial port connection | Use the **Data bits** dropdown in the **additional settings** | 5, 6, 7, 8 |
7477
| **Stop bits** | Can select how many stop bits are used for the serial port connection | Use the **Stop bits** dropdown in the **additional settings** | 1, 1.5, 2 |
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: "Compiler error C7688"
3+
description: Compiler error C7688 description and solution.
4+
ms.date: 03/01/2023
5+
f1_keywords: ["C7688"]
6+
helpviewer_keywords: ["C7688"]
7+
---
8+
# Compiler error C7688
9+
10+
> '`pragma omp atomic`': expected an expression of scalar type
11+
12+
## Remarks
13+
14+
OpenMP restricts expressions in `#pragma omp atomic` constructs to scalar type.
15+
16+
Compiler error C7688 is new in Visual Studio 2022 version 17.4. In previous compiler versions, the compiler would emit error [C3048](./compiler-error-c3048.md).
17+
18+
## Example
19+
20+
The sample code shows diagnostics generated for non-scalar types in `#pragma omp atomic` constructs.
21+
22+
```cpp
23+
// C7688.cpp
24+
// compile using /c /openmp:llvm
25+
struct S { char c; };
26+
S operator+(S, int);
27+
28+
void test()
29+
{
30+
S s1, s2;
31+
#pragma omp atomic capture
32+
{ s1 = s2; s2 = s1 + 1; }
33+
}
34+
/*
35+
When built, the compiler emits:
36+
37+
.\C7688.cpp(10,10): error C7688: '#pragma omp atomic': expected an expression of scalar type
38+
{ s1 = s2; s2 = s1 + 1; }
39+
^
40+
.\C7688.cpp(10,10): note: type is 'S'
41+
*/
42+
```
43+
44+
To resolve this issue, use scalar types in `#pragma omp atomic` constructs.

docs/error-messages/compiler-errors-2/compiler-errors-c7500-through-c7999.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ The articles in this section of the documentation explain a subset of the error
177177
| Compiler error C7660 | '%s': requires '%s' command line option(s) |
178178
| Compiler error C7661 | header-name '%s' has an ambiguous resolution to header '%s' |
179179
| Compiler error C7662 | '%$S': a coroutine cannot be constexpr or consteval |
180+
| [Compiler error C7688](compiler-error-c7688.md) | '`#pragma omp atomic`': expected an expression of scalar type |
180181
| Compiler error C7700 | type '%$T' in _Generic association compatible with previous association type '%$T' |
181182
| Compiler error C7701 | default _Generic association previously specified |
182183
| Compiler error C7702 | no compatible type for '%$T' in _Generic association list |
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: "Compiler warning (level 1, error, off) C5262"
3+
description: Compiler warning C5262 description and solution.
4+
ms.date: 03/01/2023
5+
f1_keywords: ["C5262"]
6+
helpviewer_keywords: ["C5262"]
7+
---
8+
# Compiler warning (level 1, error, off) C5262
9+
10+
> implicit fall-through occurs here; are you missing a `break` statement? Use `[[fallthrough]]` when a `break` statement is intentionally omitted between cases
11+
12+
## Remarks
13+
14+
Control flow that implicitly falls between cases of switch statements is a historical source of bugs for both C and C++. While we had the `__fallthrough` SAL macro, it wasn't useful for the build-compiler diagnostics. Since customers have legacy code that "falls through" on purpose, it isn't viable to give an actionable warning without some way of indicating an intentional fall through. In C++17, the `[[fallthrough]]` attribute was added to indicate such an instance. The compiler can take this attribute into account and suppress the new warning.
15+
16+
Compiler warning C5262 is new in Visual Studio 2022 version 17.4, and is both off by default and treated as an error by default when enabled. To continue to support legacy code without build breaks, C5262 must be explicitly enabled. For more information on how to enable this warning, see [Compiler warnings that are off by default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
17+
18+
## Example
19+
20+
The sample code shows diagnostics for `switch` cases that fall through without `break` or `return` statements or the `[[fallthrough]]` attribute.
21+
22+
```cpp
23+
// C5262.cpp
24+
// compile using /std:c++17 /we5262
25+
26+
int main(int argc, char** argv)
27+
{
28+
switch (argc)
29+
{
30+
case 0: ++argv;
31+
case 1:
32+
case 2: argv++;
33+
default:
34+
argv = 0;
35+
}
36+
}
37+
38+
/*
39+
When built, the compiler produces this output:
40+
41+
.\C5262.cpp(9,9): error C5262: implicit fall-through occurs here; are you missing a break statement? Use [[fallthrough]] when a break statement is intentionally omitted between cases
42+
case 1:
43+
^
44+
.\C5262.cpp(8,17): note: statement that may fall through is here
45+
case 0: ++argv;
46+
^
47+
.\C5262.cpp(11,9): error C5262: implicit fall-through occurs here; are you missing a break statement? Use [[fallthrough]] when a break statement is intentionally omitted between cases
48+
default:
49+
^
50+
.\C5262.cpp(10,17): note: statement that may fall through is here
51+
case 2: argv++;
52+
*/
53+
```
54+
55+
To resolve this issue when the control flow between cases is intentional, use the `[[fallthrough]]` attribute.
56+
57+
## See also
58+
59+
[`switch` statement (C++)](../../cpp/switch-statement-cpp.md)\
60+
[`[[fallthrough]]` attribute](../../cpp/attributes.md#fallthrough)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "Compiler warnings (level 1) C5301 and C5302"
3+
description: Compiler warnings C5301 and C5302 description and solution.
4+
ms.date: 03/01/2023
5+
f1_keywords: ["C5301", "C5302"]
6+
helpviewer_keywords: ["C5301", "C5302"]
7+
---
8+
# Compiler warnings (level 1) C5301 and C5302
9+
10+
> '`#pragma omp for`': '*loop-index*' increases while loop condition uses '*comparison*'; non-terminating loop?
11+
12+
> '`#pragma omp for`': '*loop-index*' decreases while loop condition uses '*comparison*'; non-terminating loop?
13+
14+
## Remarks
15+
16+
Along with improved support for OpenMP 3.1, we've added two diagnostics, C5301 and C5302, to improve the developer experience. These diagnostics check that the loop conditions for `omp parallel for` are correct, based on whether the loop index variable is increasing or decreasing. These checks work for both integral and pointer indices.
17+
18+
These compiler warnings are new in Visual Studio 2022 version 17.4.
19+
20+
## Example
21+
22+
The sample code shows a diagnostic for a `for` loop that decrements the index, but it uses a `<=` comparison that tests whether the index is less than a value higher than the starting value.
23+
24+
```C
25+
// C5302.c
26+
// compile using /openmp
27+
28+
#include <stdio.h>
29+
30+
int main()
31+
{
32+
int a[100], i;
33+
int k = 1;
34+
#pragma omp parallel for
35+
for (i = 0; i <= 100; i--)
36+
a[i] = i*i;
37+
}
38+
39+
/*
40+
Compiler warning message:
41+
42+
.\C5302.c(11,19): warning C5302: '#pragma omp for': 'i' decreases while loop condition uses '<='; non-terminating loop?
43+
for (i = 0; i <= 100; i--)
44+
^
45+
*/
46+
```
47+
48+
To resolve this issue, change the test condition or the direction of the index change to one that terminates without causing overflow, underflow, or other undefined behavior.

0 commit comments

Comments
 (0)