Skip to content

Commit 7a41a5b

Browse files
Merge pull request MicrosoftDocs#4449 from MicrosoftDocs/main638133787335717382sync_temp
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents a09ac02 + 87051bf commit 7a41a5b

24 files changed

+338
-101
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": [],
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.

docs/error-messages/compiler-warnings/compiler-warnings-by-compiler-version.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Warnings by compiler version"
33
description: "Table of Microsoft C/C++ compiler warnings by compiler version."
4-
ms.date: 11/07/2022
4+
ms.date: 02/28/2023
55
helpviewer_keywords: ["warnings, by compiler version", "cl.exe compiler, setting warning options"]
66
---
77
# Compiler Warnings by compiler version
@@ -47,13 +47,23 @@ These versions of the compiler introduced new warnings:
4747
| Visual Studio 2022 version 17.2 | 19.32 |
4848
| Visual Studio 2022 version 17.3 | 19.33 |
4949
| Visual Studio 2022 version 17.4 | 19.34 |
50+
| Visual Studio 2022 version 17.5 | 19.35 |
5051

5152
You can specify only the major number, the major and minor numbers, or the major, minor, and build numbers to the **`/Wv`** option. The compiler reports all warnings that match versions that begin with the specified number. It suppresses all warnings for versions greater than the specified number. For example, **`/Wv:17`** reports warnings introduced in or before any version of Visual Studio 2012, and suppresses warnings introduced by any compiler from Visual Studio 2013 (version 18) or later. To suppress warnings introduced in Visual Studio 2015 update 2 and later, you can use **`/Wv:19.00.23506`**. Use **`/Wv:19.11`** to report the warnings introduced in any version of Visual Studio before Visual Studio 2017 version 15.5, but suppress warnings introduced in Visual Studio 2017 version 15.5 and later.
5253

5354
The following sections list the warnings introduced by each version of Visual C++ that you can suppress by using the **`/Wv`** compiler option. The **`/Wv`** option can't suppress warnings that aren't listed, which predate the specified versions of the compiler.
5455

5556
::: moniker range=">= msvc-170"
5657

58+
## Warnings introduced in Visual Studio 2022 version 17.5 (compiler version 19.35)
59+
60+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.34`**.
61+
62+
| Warning | Message |
63+
|--|--|
64+
| C5082 | second argument to '`va_start`' is not the last named parameter |
65+
| C5265 | cannot open search path '*pathname*' |
66+
5767
## Warnings introduced in Visual Studio 2022 version 17.4 (compiler version 19.34)
5868

5969
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.33`**.

0 commit comments

Comments
 (0)