Skip to content

Commit 0c0777c

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs-pr (branch live)
2 parents da0a29c + 3cfbcc1 commit 0c0777c

File tree

3 files changed

+226
-190
lines changed

3 files changed

+226
-190
lines changed

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

Lines changed: 52 additions & 23 deletions
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: 06/11/2021
4+
ms.date: 12/01/2021
55
helpviewer_keywords: ["warnings, by compiler version", "cl.exe compiler, setting warning options"]
66
---
77
# Compiler Warnings by compiler version
@@ -38,53 +38,82 @@ These versions of the compiler introduced new warnings:
3838
| Visual Studio 2019 version 16.5 | 19.25.28610.0 |
3939
| Visual Studio 2019 version 16.6 | 19.26.28805.0 |
4040
| Visual Studio 2019 version 16.7 | 19.27.29112.0 |
41-
| Visual Studio 2019 version 16.8 | 19.28.29330.0 |
42-
| Visual Studio 2019 version 16.9 | 19.28.29500.0 |
43-
| Visual Studio 2019 version 16.10 | 19.28.30000.0 |
44-
| Visual Studio 2019 version 16.11 | 19.28.30100.0 |
41+
| Visual Studio 2019 version 16.8 | 19.28.29333.0 |
42+
| Visual Studio 2019 version 16.9 | 19.28.29700.0 |
43+
| Visual Studio 2019 version 16.10 | 19.29.30000.0 |
44+
| Visual Studio 2019 version 16.11 | 19.29.30100.0 |
45+
| Visual Studio 2022 version 17.0 RTW | 19.30 |
46+
| Visual Studio 2022 version 17.1 | 19.31 |
4547

4648
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.
4749

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

52+
::: moniker range=">= msvc-170"
53+
54+
## Warnings introduced in Visual Studio 2022 version 17.1 (compiler version 19.31)
55+
56+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.30`**.
57+
58+
| Warning | Message |
59+
|--|--|
60+
| C5251 | *segment-name* changed after including header |
61+
| C5253 | a non-local lambda cannot have a capture default |
62+
| C5254 | language feature 'terse static assert' requires compiler flag '`/std:c++17`' |
63+
64+
## Warnings introduced in Visual Studio 2022 version 17.0 (compiler version 19.30)
65+
66+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.29`**.
67+
68+
| Warning | Message |
69+
|--|--|
70+
| C5244 | '#include \<*filename*>' in the purview of module '*module-name-1*' appears erroneous. Consider moving that directive before the module declaration, or replace the textual inclusion with 'import \<*filename*>;'. |
71+
| C5245 | '*function*': unreferenced function with internal linkage has been removed |
72+
| C5246 | '*member*': the initialization of a subobject should be wrapped in braces |
73+
| C5249 | '*bitfield*' of type '*enumeration_name*' has named enumerators with values that cannot be represented in the given bit field width of '*bitfield_width*'. |
74+
| C5250 | '*function_name*': intrinsic function not declared. |
75+
| C5252 | Multiple different types resulted in the same XFG type-hash *hash-value*; the PDB will only record information for one of them |
76+
77+
::: moniker-end
78+
5079
::: moniker range=">= msvc-160"
5180

5281
## Warnings introduced in Visual Studio 2019 version 16.11 (compiler version 19.29.30100.0)
5382

54-
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.29.30000`**.
83+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.29.30099`**.
5584

5685
| Warning | Message |
5786
|--|--|
58-
| C5247 | `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` |
59-
| C5248 | `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` |
87+
| C5247 | 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 |
88+
| C5248 | 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 |
6089

6190
## Warnings introduced in Visual Studio 2019 version 16.10 (compiler version 19.29.30000.0)
6291

63-
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.29`**.
92+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.28`**.
6493

6594
| Warning | Message |
6695
|--|--|
67-
| C5233 | `explicit lambda capture 'identifier' is not used` |
68-
| C5234 | `file system error: 'filename' is not a valid header-name; ignoring` |
69-
| C5235 | `JSON parse error: issue; ignoring 'filename'` |
70-
| C5236 | `JSON ill-formed: issue; ignoring 'filename'` |
71-
| C5237 | `cannot resolve header unit entry 'string' to a header file in 'filename'; ignoring entry` |
72-
| C5238 | `file system error: cannot open 'filename' for reading; ignoring` |
73-
| C5239 | `'Symbol': potentially-throwing function called from a function declared __declspec(nothrow). Undefined behavior may occur if an exception is thrown.` |
74-
| C5240 | `'attribute-string': attribute is ignored in this syntactic position` |
75-
| C5241 | `'/exportHeader' usage to lookup header-name is deprecated; prefer '/headerName:arg-1 arg-2=filename'` |
76-
| C5242 | `syntax error in pragma 'identifier'` |
77-
| C5243 | `'Type-name': using incomplete class 'symbol' can cause potential one definition rule violation due to ABI limitation` |
96+
| C5233 | explicit lambda capture '*identifier*' is not used |
97+
| C5234 | file system error: '*filename*' is not a valid header-name; ignoring |
98+
| C5235 | JSON parse error: issue; ignoring '*filename*' |
99+
| C5236 | JSON ill-formed: issue; ignoring '*filename*' |
100+
| C5237 | cannot resolve header unit entry '*string*' to a header file in '*filename*'; ignoring entry |
101+
| C5238 | file system error: cannot open '*filename*' for reading; ignoring |
102+
| C5239 | '*Symbol*': potentially-throwing function called from a function declared `__declspec(nothrow)`. Undefined behavior may occur if an exception is thrown. |
103+
| C5240 | '*attribute-string*': attribute is ignored in this syntactic position |
104+
| C5241 | '`/exportHeader`' usage to lookup header-name is deprecated; prefer '`/headerName:arg-1 arg-2=filename`' |
105+
| C5242 | syntax error in pragma '*pragma-name*' |
106+
| C5243 | '*Type-name*': using incomplete class '*symbol*' can cause potential one definition rule violation due to ABI limitation |
78107

79108
## Warnings introduced in Visual Studio 2019 version 16.9 (compiler version 19.28.29700.0)
80109

81-
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.28.29500`**.
110+
These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.28.29699`**.
82111

83112
| Warning | Message |
84113
|--|--|
85-
| C5232 | `in C++20 this comparison calls 'identifier' recursively` |
114+
| C5232 | in C++20 this comparison calls '*identifier*' recursively |
86115

87-
## Warnings introduced in Visual Studio 2019 version 16.8 (compiler version 19.28.29330.0)
116+
## Warnings introduced in Visual Studio 2019 version 16.8 (compiler version 19.28.29333.0)
88117

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

0 commit comments

Comments
 (0)