|
1 | 1 | ---
|
2 | 2 | title: "Compiler Warnings by compiler version"
|
3 | 3 | description: "Table of Microsoft C/C++ compiler warnings by compiler version."
|
4 |
| -ms.date: 06/11/2021 |
| 4 | +ms.date: 12/01/2021 |
5 | 5 | helpviewer_keywords: ["warnings, by compiler version", "cl.exe compiler, setting warning options"]
|
6 | 6 | ---
|
7 | 7 | # Compiler Warnings by compiler version
|
@@ -38,53 +38,82 @@ These versions of the compiler introduced new warnings:
|
38 | 38 | | Visual Studio 2019 version 16.5 | 19.25.28610.0 |
|
39 | 39 | | Visual Studio 2019 version 16.6 | 19.26.28805.0 |
|
40 | 40 | | 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 | |
45 | 47 |
|
46 | 48 | 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.
|
47 | 49 |
|
48 | 50 | 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.
|
49 | 51 |
|
| 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 | + |
50 | 79 | ::: moniker range=">= msvc-160"
|
51 | 80 |
|
52 | 81 | ## Warnings introduced in Visual Studio 2019 version 16.11 (compiler version 19.29.30100.0)
|
53 | 82 |
|
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`**. |
55 | 84 |
|
56 | 85 | | Warning | Message |
|
57 | 86 | |--|--|
|
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 | |
60 | 89 |
|
61 | 90 | ## Warnings introduced in Visual Studio 2019 version 16.10 (compiler version 19.29.30000.0)
|
62 | 91 |
|
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`**. |
64 | 93 |
|
65 | 94 | | Warning | Message |
|
66 | 95 | |--|--|
|
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 | |
78 | 107 |
|
79 | 108 | ## Warnings introduced in Visual Studio 2019 version 16.9 (compiler version 19.28.29700.0)
|
80 | 109 |
|
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`**. |
82 | 111 |
|
83 | 112 | | Warning | Message |
|
84 | 113 | |--|--|
|
85 |
| -| C5232 | `in C++20 this comparison calls 'identifier' recursively` | |
| 114 | +| C5232 | in C++20 this comparison calls '*identifier*' recursively | |
86 | 115 |
|
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) |
88 | 117 |
|
89 | 118 | These warnings and all warnings in later versions are suppressed by using the compiler option **`/Wv:19.27`**.
|
90 | 119 |
|
|
0 commit comments