Skip to content

Commit 806226c

Browse files
committed
Updates for v17.3
1 parent 6175a3a commit 806226c

4 files changed

Lines changed: 75 additions & 9 deletions

File tree

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,39 @@ These versions of the compiler introduced new warnings:
4444
| Visual Studio 2019 version 16.11 | 19.29.30100.0 |
4545
| Visual Studio 2022 version 17.0 RTW | 19.30 |
4646
| Visual Studio 2022 version 17.1 | 19.31 |
47+
| Visual Studio 2022 version 17.2 | 19.32 |
48+
| Visual Studio 2022 version 17.3 | 19.33 |
4749

4850
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.
4951

5052
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.
5153

5254
::: moniker range=">= msvc-170"
5355

56+
## Warnings introduced in Visual Studio 2022 version 17.3 (compiler version 19.33)
57+
58+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.32`**.
59+
60+
| Warning | Message |
61+
|--|--|
62+
| C5259 | '*specialized-type*': explicit specialization requires 'template <>' |
63+
64+
## Warnings introduced in Visual Studio 2022 version 17.2 (compiler version 19.32)
65+
66+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.31`**.
67+
68+
| Warning | Message |
69+
|--|--|
70+
| C4983 | '/analyze:sarif:hashname' ignored because the argument to '/analyze:log' is a single file rather than a directory |
71+
| C5081 | Secure hotpatch is not supported with /GENPROFILE, /FASTGENPROFILE or /LTCG:PGI, disabling secure hotpatch. |
72+
| C5255 | unterminated bidirectional character encountered: 'U+XXXX' |
73+
| C5256 | '*enumeration*': a non-defining declaration of an enumeration with a fixed underlying type is only permitted as a standalone declaration |
74+
| C5257 | '*enumeration*': enumeration was previously declared without a fixed underlying type |
75+
| C5258 | explicit capture of '*symbol*' is not required for this use |
76+
| C5300 | '#pragma omp atomic': left operand of '*operator*' must match left hand side of assignment-expression |
77+
| C5301 | '#pragma omp for': '*symbol*' increases while loop condition uses '*comparison*'; non-terminating loop? |
78+
| C5302 | '#pragma omp for': '*symbol*' decreases while loop condition uses '*comparison*'; non-terminating loop? |
79+
5480
## Warnings introduced in Visual Studio 2022 version 17.1 (compiler version 19.31)
5581

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

‎docs/error-messages/compiler-warnings/compiler-warnings-c4800-through-c4999.md‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: "Compiler warnings C4800 Through C5999"
33
description: "Table of Microsoft C/C++ compiler warnings C4800 through C5999."
4-
ms.date: 02/22/2022
5-
f1_keywords: ["C4808", "C4809", "C4825", "C4827", "C4837", "C4842", "C4844", "C4845", "C4846", "C4847", "C4848", "C4854", "C4855", "C4856", "C4857", "C4872", "C4880", "C4881", "C4882", "C4916", "C4921", "C4934", "C4954", "C4955", "C4963", "C4966", "C4970", "C4971", "C4973", "C4974", "C4981", "C4987", "C4988", "C4989", "C4990", "C4991", "C4992", "C4998", "C5022", "C5023", "C5024", "C5025", "C5026", "C5027", "C5028", "C5029", "C5030", "C5031", "C5032", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5057", "C5058", "C5059", "C5060", "C5061", "C5062", "C5063", "C5100", "C5101", "C5102", "C5103", "C5104", "C5106", "C5107", "C5108", "C5200", "C5201", "C5202", "C5203", "C5204", "C5205", "C5206", "C5207", "C5209", "C5210", "C5211", "C5212", "C5213", "C5214", "C5215", "C5216", "C5217", "C5218", "C5219", "C5220", "C5221", "C5222", "C5223", "C5224", "C5225", "C5226", "C5227", "C5228", "C5229", "C5230", "C5231", "C5232", "C5233", "C5234", "C5235", "C5236", "C5237", "C5238", "C5239", "C5241", "C5242", "C5244", "C5245", "C5246", "C5249", "C5250", "C5251", "C5252", "C5253", "C5254"]
6-
helpviewer_keywords: ["C4808", "C4809", "C4825", "C4827", "C4837", "C4842", "C4844", "C4845", "C4846", "C4847", "C4848", "C4854", "C4855", "C4856", "C4857", "C4872", "C4880", "C4881", "C4882", "C4916", "C4921", "C4934", "C4954", "C4955", "C4963", "C4966", "C4970", "C4971", "C4973", "C4974", "C4981", "C4987", "C4988", "C4989", "C4990", "C4991", "C4992", "C4998", "C5022", "C5023", "C5024", "C5025", "C5026", "C5027", "C5028", "C5029", "C5030", "C5031", "C5032", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5057", "C5058", "C5059", "C5060", "C5061", "C5062", "C5063", "C5100", "C5101", "C5102", "C5103", "C5104", "C5106", "C5107", "C5108", "C5200", "C5201", "C5202", "C5203", "C5204", "C5205", "C5206", "C5207", "C5209", "C5210", "C5211", "C5212", "C5213", "C5214", "C5215", "C5216", "C5217", "C5218", "C5219", "C5220", "C5221", "C5222", "C5223", "C5224", "C5225", "C5226", "C5227", "C5228", "C5229", "C5230", "C5231", "C5232", "C5233", "C5234", "C5235", "C5236", "C5237", "C5238", "C5239", "C5241", "C5242", "C5244", "C5245", "C5246", "C5249", "C5250", "C5251", "C5252", "C5253", "C5254"]
4+
ms.date: 08/08/2022
5+
f1_keywords: ["C4808", "C4809", "C4825", "C4827", "C4837", "C4842", "C4844", "C4845", "C4846", "C4847", "C4848", "C4854", "C4855", "C4856", "C4857", "C4872", "C4880", "C4881", "C4882", "C4916", "C4921", "C4934", "C4954", "C4955", "C4963", "C4966", "C4970", "C4971", "C4973", "C4974", "C4981", "C4983", "C4987", "C4988", "C4989", "C4990", "C4991", "C4992", "C4998", "C5022", "C5023", "C5024", "C5025", "C5026", "C5027", "C5028", "C5029", "C5030", "C5031", "C5032", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5057", "C5058", "C5059", "C5060", "C5061", "C5062", "C5063", "C5081", "C5100", "C5101", "C5102", "C5103", "C5104", "C5106", "C5107", "C5108", "C5200", "C5201", "C5202", "C5203", "C5204", "C5205", "C5206", "C5207", "C5209", "C5210", "C5211", "C5212", "C5213", "C5214", "C5215", "C5216", "C5217", "C5218", "C5219", "C5220", "C5221", "C5222", "C5223", "C5224", "C5225", "C5226", "C5227", "C5228", "C5229", "C5230", "C5231", "C5232", "C5233", "C5234", "C5235", "C5236", "C5237", "C5238", "C5239", "C5241", "C5242", "C5244", "C5245", "C5246", "C5249", "C5250", "C5251", "C5252", "C5253", "C5254", "C5255", "C5256", "C5257", "C5258", "C5300", "C5301", "C5302"]
6+
helpviewer_keywords: ["C4808", "C4809", "C4825", "C4827", "C4837", "C4842", "C4844", "C4845", "C4846", "C4847", "C4848", "C4854", "C4855", "C4856", "C4857", "C4872", "C4880", "C4881", "C4882", "C4916", "C4921", "C4934", "C4954", "C4955", "C4963", "C4966", "C4970", "C4971", "C4973", "C4974", "C4981", "C4983", "C4987", "C4988", "C4989", "C4990", "C4991", "C4992", "C4998", "C5022", "C5023", "C5024", "C5025", "C5026", "C5027", "C5028", "C5029", "C5030", "C5031", "C5032", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5057", "C5058", "C5059", "C5060", "C5061", "C5062", "C5063", "C5081", "C5100", "C5101", "C5102", "C5103", "C5104", "C5106", "C5107", "C5108", "C5200", "C5201", "C5202", "C5203", "C5204", "C5205", "C5206", "C5207", "C5209", "C5210", "C5211", "C5212", "C5213", "C5214", "C5215", "C5216", "C5217", "C5218", "C5219", "C5220", "C5221", "C5222", "C5223", "C5224", "C5225", "C5226", "C5227", "C5228", "C5229", "C5230", "C5231", "C5232", "C5233", "C5234", "C5235", "C5236", "C5237", "C5238", "C5239", "C5241", "C5242", "C5244", "C5245", "C5246", "C5249", "C5250", "C5251", "C5252", "C5253", "C5254", "C5255", "C5256", "C5257", "C5258", "C5300", "C5301", "C5302"]
77
---
88
# Compiler warnings C4800 through C5999
99

@@ -116,6 +116,7 @@ The articles in this section of the documentation explain a subset of the warnin
116116
| Compiler warning (level 1) C4973 | '*symbol*': marked as deprecated |
117117
| Compiler warning (level 1) C4974 | '*symbol*': marked as deprecated |
118118
| Compiler warning (level 3) C4981 | Warbird: function '*function*' marked as __forceinline not inlined because it contains exception semantics |
119+
| Compiler warning (level 3) C4983 | '/analyze:sarif:hashname' ignored because the argument to '/analyze:log' is a single file rather than a directory |
119120
| [Compiler warning C4984](compiler-warning-c4984.md) | '`if constexpr`' is a C++17 language extension |
120121
| [Compiler warning (level 4) C4985](compiler-warning-level-4-c4985.md) | '*symbol_name*': attributes not present on previous declaration. |
121122
| [Compiler warning (level 4, off) C4986](compiler-warning-c4986.md) | '*declaration*': exception specification does not match previous declaration |
@@ -172,6 +173,7 @@ The articles in this section of the documentation explain a subset of the warnin
172173
| Compiler warning (level 4) C5061 | the use of a comma operator as a subscript expression has been deprecated |
173174
| Compiler warning (level 4) C5062 | enum direct list initialization between 'type-1' and 'type-2' is no longer supported |
174175
| Compiler warning (level 1) C5063 | '`std::is_constant_evaluated`' always evaluates to true in manifestly constant-evaluated expressions |
176+
| Compiler warning (level 1) C5081 | Secure hotpatch is not supported with `/GENPROFILE`, `/FASTGENPROFILE` or `/LTCG:PGI`, disabling secure hotpatch. |
175177
| Compiler warning (level 1) C5100 | `__VA_ARGS__` is reserved for use in variadic macros |
176178
| Compiler warning (level 1) C5101 | use of preprocessor directive in function-like macro argument list is undefined behavior |
177179
| Compiler warning (level 1) C5102 | ignoring invalid command-line macro definition '*value*' |
@@ -229,12 +231,19 @@ The articles in this section of the documentation explain a subset of the warnin
229231
| Compiler warning (level 1, off) C5246 | '*member*': the initialization of a subobject should be wrapped in braces |
230232
| [Compiler warning (level 1, off) C5247](c5247.md) | section '*section-name*' is reserved for C++ dynamic initialization. Manually creating the section will interfere with C++ dynamic initialization and may lead to undefined behavior |
231233
| [Compiler warning (level 1, off) C5248](c5248.md) | section '*section-name*' is reserved for C++ dynamic initialization. Variables manually put into the section may be optimized out and their order relative to compiler generated dynamic initializers is unspecified. |
232-
| Compiler warning (level 1, off) C5249 | '*bitfield*' of type '*enumeration_name*' has named enumerators with values that cannot be represented in the given bit field width of '*bitfield_width*'. <sup>17.0</sup> |
233-
| Compiler warning (level 3, off) C5250 | '*function_name*': intrinsic function not declared. <sup>17.0</sup> |
234-
| Compiler warning (level 4, off) C5251 | *segment-name* changed after including header <sup>17.1</sup> |
235-
| Compiler warning (level 4) C5252 | Multiple different types resulted in the same XFG type-hash *hash-value*; the PDB will only record information for one of them <sup>17.0</sup> |
236-
| Compiler warning (level 4) C5253 | a non-local lambda cannot have a capture default <sup>17.1</sup> |
237-
| Compiler warning (level 4, off) C5254 | language feature 'terse static assert' requires compiler flag '/std:c++17' <sup>17.1</sup> |
234+
| Compiler warning (level 1, off) C5249 | '*bitfield*' of type '*enumeration_name*' has named enumerators with values that cannot be represented in the given bit field width of '*bitfield_width*'. |
235+
| Compiler warning (level 3, off) C5250 | '*function_name*': intrinsic function not declared. |
236+
| Compiler warning (level 4, off) C5251 | *segment-name* changed after including header |
237+
| Compiler warning (level 4) C5252 | Multiple different types resulted in the same XFG type-hash *hash-value*; the PDB will only record information for one of them |
238+
| Compiler warning (level 4) C5253 | a non-local lambda cannot have a capture default |
239+
| Compiler warning (level 4, off) C5254 | language feature 'terse static assert' requires compiler flag '/std:c++17' |
240+
| Compiler warning (level 3) C5255 | unterminated bidirectional character encountered: 'U+XXXX' |
241+
| Compiler warning (level 1, off) C5256 | '*enumeration*': a non-defining declaration of an enumeration with a fixed underlying type is only permitted as a standalone declaration |
242+
| Compiler warning (level 1 or 4) C5257 | '*enumeration*': enumeration was previously declared without a fixed underlying type |
243+
| Compiler warning (level 4, off) C5258 | explicit capture of '*symbol*' is not required for this use |
244+
| Compiler warning (level 1, error) C5300 | '#pragma omp atomic': left operand of '*operator*' must match left hand side of assignment-expression |
245+
| Compiler warning (level 1) C5301 | '#pragma omp for': '*symbol*' increases while loop condition uses '*comparison*'; non-terminating loop? |
246+
| Compiler warning (level 1) C5302 | '#pragma omp for': '*symbol*' decreases while loop condition uses '*comparison*'; non-terminating loop? |
238247

239248
## See also
240249

‎docs/overview/cpp-conformance-improvements.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,36 @@ Microsoft C/C++ in Visual Studio (MSVC) makes conformance improvements and bug f
1010

1111
This document lists the changes in Visual Studio 2022. For a guide to the changes in Visual Studio 2019, see [C++ conformance improvements in Visual Studio 2019](cpp-conformance-improvements-2019.md). For changes in Visual Studio 2017, see [C++ conformance improvements in Visual Studio 2017](cpp-conformance-improvements-2017.md). For a complete list of previous conformance improvements, see [Visual C++ What's New 2003 through 2015](../porting/visual-cpp-what-s-new-2003-through-2015.md).
1212

13+
## <a name="improvements_173"></a> Conformance improvements in Visual Studio 2022 version 17.2
14+
15+
Visual Studio 2022 version 17.3 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
16+
1317
## <a name="improvements_172"></a> Conformance improvements in Visual Studio 2022 version 17.2
1418

1519
Visual Studio 2022 version 17.2 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
1620

21+
### C: Improved modifier compatibility checking between pointers
22+
23+
The C compiler didn't properly compare modifiers between pointers, especially `void*`. This could result in an improper diagnosis of incompatibility between `const int**` and `void*` and compatibility between `int* volatile*` and `void*`.
24+
25+
This change is guarded by the `/Wv` flag.
26+
27+
#### Example
28+
29+
```c
30+
void fn(void* pv) { (pv); }
31+
32+
int main()
33+
{
34+
int t = 42;
35+
int* pt = &t;
36+
int* volatile * i = &pt;
37+
fn(i); // Now raises C4090
38+
const int** j = &pt;
39+
fn(j); // No longer raises C4090
40+
}
41+
```
42+
1743
### Unterminated bidirectional character warnings
1844
1945
Visual Studio 2022 version 17.2 adds level 3 warning C5255 for unterminated Unicode bidirectional characters in comments and strings. The warning addresses a security concern described in [Trojan Source: Invisible Vulnerabilities](https://www.trojansource.codes/trojan-source.pdf) by Nicholas Boucher and Ross Anderson. For more information on Unicode bidirectional characters, see [Unicode® Standard Annex #9: UNICODE BIDIRECTIONAL ALGORITHM](https://unicode.org/reports/tr9/).

‎docs/preprocessor/compiler-warnings-that-are-off-by-default.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ The following warnings are turned off by default in Visual Studio 2015 and later
162162
| C5250 (level 3) | '*function_name*': intrinsic function not declared. <sup>17.0</sup> |
163163
| C5251 (level 4) | *segment-name* changed after including header <sup>17.1</sup> |
164164
| C5254 (level 4) | language feature 'terse static assert' requires compiler flag '/std:c++17' <sup>17.1</sup> |
165+
| C5256 (level 1) | '*enumeration*': a non-defining declaration of an enumeration with a fixed underlying type is only permitted as a standalone declaration <sup>17.2</sup> |
166+
| C5258 (level 4) | explicit capture of '*symbol*' is not required for this use <sup>17.2</sup> |
167+
| C5259 (level 4) | '*specialized-type*': explicit specialization requires 'template <>' <sup>17.3</sup> |
165168

166169
<sup>14.1</sup> This warning is available starting in Visual Studio 2015 Update 1.\
167170
<sup>14.3</sup> This warning is available starting in Visual Studio 2015 Update 3.\
@@ -177,6 +180,8 @@ The following warnings are turned off by default in Visual Studio 2015 and later
177180
<sup>16.11</sup> This warning is available starting in Visual Studio 2019 version 16.11.\
178181
<sup>17.0</sup> This warning is available starting in Visual Studio 2022 version 17.0.\
179182
<sup>17.1</sup> This warning is available starting in Visual Studio 2022 version 17.1.\
183+
<sup>17.2</sup> This warning is available starting in Visual Studio 2022 version 17.2.\
184+
<sup>17.3</sup> This warning is available starting in Visual Studio 2022 version 17.3.\
180185
<sup>Perm</sup> This warning is off unless the [`/permissive-`](../build/reference/permissive-standards-conformance.md) compiler option is set.
181186

182187
## Warnings off by default in earlier versions

0 commit comments

Comments
 (0)