Skip to content

Commit cf66aaf

Browse files
TaojunshenColin Robertsonopbld15TylerMSFTTylerMSFT
authored
8/10/2021 AM Publish (MicrosoftDocs#3712)
* fix code sample (#3676) * fix code sample * acrolinx Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> * Address 3269 typo in warning number (#3680) * Fixed typo: evalution --> evaluation * Fixed typo: evalution --> evaluation * Bulk Fix - Sentence form for all alt text (#3683) * Updated C/C++ workload name The workload for C/C++ development in VS Build Tools 2019 installer is called 'Desktop development with C++'. * Split out docs by version Add VS2017-specific instructions. * Updated C/C++ workload name The workload for C/C++ development in VS Build Tools 2019 installer is called 'Desktop development with C++'. * Split out docs by version Add VS2017-specific instructions. * Add 16.11 Compiler Warnings C5247 and C5248 (MicrosoftDocs#3689) * Add C5247 and C5248 * Fix link typos * Updates per Xiang Fan review * More wordsmithage * More fix per X.F. * Fix inconsistencies in CMake docs (MicrosoftDocs#3692) * Standard format for CMake docs * Fix markdownlint * More cleanup. * Clean up link issue, acrolinx * Fix more broken things * Undo a change * Update markdownlint.json file for unordered lists (#3694) Block rule that wants * instead of - to prefix unordered lists, since we've standardized on the latter. Merging on my own recognizance as repo admin. * Markdown quality fixes 1 of N * Markdown quality fixes 2 of N * Markdown quality fixes 3 of N * Markdown quality fixes 4 of N * Markdown quality fixes 5 of N * Markdown quality fixes 6 of N * Markdown quality fixes 7 of N * Markdown quality fixes 8 of N * Markdown quality fixes 9 of N * Markdown quality fixes 10 of N * Undo TN038 * Markdown quality fixes 11 of N * Setting PATH allows DUMPBIN to be executed from the system command prompt. There are multiple DUMPBIN.EXE's in the MSVC folder, but they can be executed if the PATH is set correctly. If this is not true, or undesireable per system design constraints, please clarify otherwise. * Add link to environment setting instructions * Address cpp-docs 3286 Postfix increment, decrement syntax (MicrosoftDocs#3711) * Address cpp-docs issue 3286 * Fix formatting, final example * Add compiler warning C5243, C5249, C5250 (MicrosoftDocs#3710) Co-authored-by: Colin Robertson <corob@microsoft.com> Co-authored-by: opbld15 <opbld15@microsoft.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: opbld17 <opbld17@microsoft.com> Co-authored-by: ystamant <49958001+ystamant@users.noreply.github.com> Co-authored-by: opbld16 <opbld16@microsoft.com> Co-authored-by: Andrew Shymanel <88244804+ainrd@users.noreply.github.com> Co-authored-by: PRMerger6 <prmrgr6@microsoft.com> Co-authored-by: PRMerger12 <prmrgr12@microsoft.com> Co-authored-by: PRMerger14 <prmrgr14@microsoft.com> Co-authored-by: PRMerger16 <prmrgr16@microsoft.com> Co-authored-by: PRMerger15 <prmrgr15@microsoft.com> Co-authored-by: PRMerger7 <prmrgr7@microsoft.com> Co-authored-by: PRMerger10 <prmrgr10@microsoft.com> Co-authored-by: David Dyck <david.dyck@gmail.com>
1 parent 31aa2af commit cf66aaf

6 files changed

Lines changed: 52 additions & 20 deletions

File tree

docs/build/reference/dumpbin-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: DUMPBIN Reference"
33
title: "DUMPBIN Reference"
4-
ms.date: "11/04/2016"
4+
ms.date: 08/09/2021
55
f1_keywords: ["dumpbin"]
66
helpviewer_keywords: ["binary data, binary file dumper", "DUMPBIN program", "Microsoft COFF binary file dumper", "COFF files, displaying information about", "binary file dumper"]
77
ms.assetid: 4bc06822-5330-44b4-8a3f-6180dfd41dfb
@@ -11,7 +11,7 @@ ms.assetid: 4bc06822-5330-44b4-8a3f-6180dfd41dfb
1111
The Microsoft COFF Binary File Dumper (DUMPBIN.EXE) displays information about Common Object File Format (COFF) binary files. You can use DUMPBIN to examine COFF object files, standard libraries of COFF objects, executable files, and dynamic-link libraries (DLLs).
1212

1313
> [!NOTE]
14-
> You can start this tool only from the Visual Studio command prompt. You cannot start it from a system command prompt or from File Explorer.
14+
> We recommend you run DUMPBIN from the Visual Studio command prompt. You can't start it from a system command prompt unless you set the environment correctly. For more information, see [Use the Microsoft C++ toolset from the command line](../building-on-the-command-line.md).
1515
1616
Only the [/HEADERS](headers.md) DUMPBIN option is available for use on files produced with the [/GL](gl-whole-program-optimization.md) compiler option.
1717

docs/cpp/increment-and-decrement-operator-overloading-cpp.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Increment and Decrement Operator Overloading (C++)"
33
title: "Increment and Decrement Operator Overloading (C++)"
4-
ms.date: "11/04/2016"
4+
ms.date: 08/09/2021
55
helpviewer_keywords: ["increment operators [C++]", "increment operators [C++], types of", "decrement operators [C++]", "decrement operators [C++], types of"]
66
ms.assetid: 5423c6ce-3999-4a77-92f6-ad540add1b1d
77
---
@@ -13,7 +13,7 @@ The increment and decrement operators fall into a special category because there
1313

1414
- Predecrement and postdecrement
1515

16-
When you write overloaded operator functions, it can be useful to implement separate versions for the prefix and postfix versions of these operators. To distinguish between the two, the following rule is observed: The prefix form of the operator is declared exactly the same way as any other unary operator; the postfix form accepts an additional argument of type **`int`**.
16+
When you write overloaded operator functions, it can be useful to implement separate versions for the prefix and postfix versions of these operators. To distinguish between the two, the following rule is observed: The prefix form of the operator is declared exactly the same way as any other unary operator; the postfix form accepts an extra argument of type **`int`**.
1717

1818
> [!NOTE]
1919
> When specifying an overloaded operator for the postfix form of the increment or decrement operator, the additional argument must be of type **`int`**; specifying any other type generates an error.
@@ -74,48 +74,51 @@ Point Point::operator--(int)
7474
--*this;
7575
return temp;
7676
}
77+
7778
int main()
7879
{
7980
}
8081
```
8182

82-
The same operators can be defined in file scope (globally) using the following function heads:
83+
The same operators can be defined in file scope (globally) using the following function prototypes:
8384

8485
```cpp
85-
friend Point& operator++( Point& ) // Prefix increment
86-
friend Point& operator++( Point&, int ) // Postfix increment
87-
friend Point& operator--( Point& ) // Prefix decrement
88-
friend Point& operator--( Point&, int ) // Postfix decrement
86+
friend Point& operator++( Point& ); // Prefix increment
87+
friend Point operator++( Point&, int ); // Postfix increment
88+
friend Point& operator--( Point& ); // Prefix decrement
89+
friend Point operator--( Point&, int ); // Postfix decrement
8990
```
9091

91-
The argument of type **`int`** that denotes the postfix form of the increment or decrement operator is not commonly used to pass arguments. It usually contains the value 0. However, it can be used as follows:
92+
The argument of type **`int`** that denotes the postfix form of the increment or decrement operator isn't commonly used to pass arguments. It usually contains the value 0. However, it can be used as follows:
9293

9394
```cpp
9495
// increment_and_decrement2.cpp
9596
class Int
9697
{
9798
public:
98-
Int &operator++( int n );
99+
Int operator++( int n ); // Postfix increment operator
99100
private:
100101
int _i;
101102
};
102103

103-
Int& Int::operator++( int n )
104+
Int Int::operator++( int n )
104105
{
106+
Int result = *this;
105107
if( n != 0 ) // Handle case where an argument is passed.
106108
_i += n;
107109
else
108110
_i++; // Handle case where no argument is passed.
109-
return *this;
111+
return result;
110112
}
113+
111114
int main()
112115
{
113116
Int i;
114117
i.operator++( 25 ); // Increment by 25.
115118
}
116119
```
117120

118-
There is no syntax for using the increment or decrement operators to pass these values other than explicit invocation, as shown in the preceding code. A more straightforward way to implement this functionality is to overload the addition/assignment operator (**+=**).
121+
There's no syntax for using the increment or decrement operators to pass these values other than explicit invocation, as shown in the preceding code. A more straightforward way to implement this functionality is to overload the addition/assignment operator (**+=**).
119122

120123
## See also
121124

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "Compiler Warning C5243"
3+
description: Compiler warning C5243 description and solution.
4+
ms.date: 08/09/2021
5+
f1_keywords: ["C5243"]
6+
helpviewer_keywords: ["C5243"]
7+
---
8+
# Compiler Warning C5243
9+
10+
> '*type*': using incomplete class '*class-name*' can cause ODR violation due to ABI limitation. You can workaround the issue by specifying inheritance keyword on the forward declaration of the class.
11+
12+
## Remarks
13+
14+
The Microsoft C++ ABI in Visual Studio 2019 and earlier versions uses more than one kind of pointer-to-member type. These types have different sizes that depend on the inheritance model used by the class. The C++ standard allows you to declare a pointer-to-member of an incomplete class type. If you declare a variable of pointer-to-member type for an incomplete class, the compiler must use the most general representation. It can lead to a *one definition rule*, or ODR violation, since the compiler may use a smaller, more specific representation for this pointer-to-member type in other translation units where the complete class type is available.
15+
16+
To resolve this error, you can specify the complete class type before you declare the pointer-to-member variable. Or, use a Microsoft-specific [inheritance keyword](../../cpp/inheritance-keywords.md) to specify the correct inheritance model on the incomplete forward class declaration.
17+
18+
Compiler Warning C5243 is new in Visual Studio 2019 version 16.10 and is off by default. 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).
19+
20+
## See also
21+
22+
[Inheritance keywords](../../cpp/inheritance-keywords.md)

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

Lines changed: 6 additions & 4 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: 06/11/2021
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", "C5033", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5054", "C5055", "C5056", "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", "C5240", "C5241", "C5242", "C5243", "C5244", "C5245", "C5246"]
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", "C5033", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5054", "C5055", "C5056", "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", "C5240", "C5241", "C5242", "C5243", "C5244", "C5245", "C5246"]
4+
ms.date: 08/09/2021
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", "C5033", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5054", "C5055", "C5056", "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", "C5240", "C5241", "C5242", "C5244", "C5245", "C5246", "C5249", "C5250"]
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", "C5033", "C5034", "C5035", "C5036", "C5039", "C5040", "C5041", "C5042", "C5043", "C5044", "C5047", "C5048", "C5049", "C5051", "C5052", "C5053", "C5054", "C5055", "C5056", "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", "C5240", "C5241", "C5242", "C5244", "C5245", "C5246", "C5249", "C5250"]
77
---
88
# Compiler warnings C4800 through C5999
99

@@ -223,12 +223,14 @@ The articles in this section of the documentation explain a subset of the warnin
223223
| Compiler warning (level 4) C5240 | '*name*': attribute is ignored in this syntactic position |
224224
| Compiler warning (level 1) C5241 | '`/exportHeader`' usage to lookup header-name is deprecated; prefer '/headerName:name value=filename' |
225225
| Compiler warning (level 1) C5242 | syntax error in pragma '*identifier*' |
226-
| Compiler warning (level 1) C5243 | '*type-name*': using incomplete class 'class-name' can cause potential one definition rule violation due to ABI limitation |
226+
| [Compiler warning (level 1) C5243](c5243.md) | '*type-name*': using incomplete class 'class-name' can cause potential one definition rule violation due to ABI limitation |
227227
| Compiler warning (level 1) 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 \<*module-name-2*>;'. |
228228
| Compiler warning (level 4) C5245 | '*function*': unreferenced function with internal linkage has been removed |
229229
| Compiler warning (level 1) C5246 | '*member*': the initialization of a subobject should be wrapped in braces |
230230
| [Compiler warning (level 1) 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 |
231231
| [Compiler warning (level 1) 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) 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) C5250 | '*function_name*': intrinsic function not declared. <sup>17.0</sup> |
232234

233235
## See also
234236

docs/error-messages/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4296,6 +4296,8 @@
42964296
href: compiler-warnings/c5105.md
42974297
- name: Compiler warning (level 1) C5208
42984298
href: compiler-warnings/c5208.md
4299+
- name: Compiler warning (level 1) C5243
4300+
href: compiler-warnings/c5243.md
42994301
- name: Compiler warning (level 1) C5247
43004302
href: compiler-warnings/c5247.md
43014303
- name: Compiler warning (level 1) C5248

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Compiler warnings that are off by default"
33
title: "Compiler warnings that are off by default"
4-
ms.date: "08/29/2019"
4+
ms.date: 08/09/2021
55
helpviewer_keywords: ["warnings, compiler", "cl.exe compiler, setting options"]
66
ms.assetid: 69809cfb-a38a-4035-b154-283a61938df8
77
---
@@ -153,11 +153,13 @@ The following warnings are turned off by default in Visual Studio 2015 and later
153153
| C5220 (level 4) | '*member*': a non-static data member with a volatile qualified type no longer implies that<br/> compiler generated copy/move constructors and copy/move assignment operators are not trivial <sup>16.7</sup> |
154154
| C5233 (level 4) | explicit lambda capture '*identifier*' is not used <sup>16.10</sup> |
155155
| C5240 (level 4) | '*attribute-name*': attribute is ignored in this syntactic position <sup>16.10</sup> |
156-
| C5243 (level 1) | '*type-name*': using incomplete class '*class-name*' can cause potential one definition rule violation due to ABI limitation <sup>16.10</sup> |
156+
| [C5243 (level 1)](../error-messages/compiler-warnings/c5247.md) | '*type-name*': using incomplete class '*class-name*' can cause potential one definition rule violation due to ABI limitation <sup>16.10</sup> |
157157
| C5245 (level 4) | '*function*': unreferenced function with internal linkage has been removed |
158158
| C5246 (level 1) | '*member*': the initialization of a subobject should be wrapped in braces <sup>16.10</sup> |
159159
| [C5247 (level 1)](../error-messages/compiler-warnings/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 <sup>16.11</sup> |
160160
| [C5248 (level 1)](../error-messages/compiler-warnings/c5248.md) | Section '*section-name*' is reserved for C++ dynamic initialization. Variable manually put into the section may be optimized out and its order relative to compiler generated dynamic initializers is unspecified <sup>16.11</sup> |
161+
| C5249 (level 1) | '*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> |
162+
| C5250 (level 3) | '*function_name*': intrinsic function not declared. <sup>17.0</sup> |
161163

162164
<sup>14.1</sup> This warning is available starting in Visual Studio 2015 Update 1.\
163165
<sup>14.3</sup> This warning is available starting in Visual Studio 2015 Update 3.\
@@ -171,6 +173,7 @@ The following warnings are turned off by default in Visual Studio 2015 and later
171173
<sup>16.7</sup> This warning is available starting in Visual Studio 2019 version 16.7.\
172174
<sup>16.10</sup> This warning is available starting in Visual Studio 2019 version 16.10.\
173175
<sup>16.11</sup> This warning is available starting in Visual Studio 2019 version 16.11.\
176+
<sup>17.0</sup> This warning is available starting in Visual Studio 2022 version 17.0.\
174177
<sup>Perm</sup> This warning is off unless the [`/permissive-`](../build/reference/permissive-standards-conformance.md) compiler option is set.
175178

176179
## Warnings off by default in earlier versions

0 commit comments

Comments
 (0)