Skip to content

Commit 937735e

Browse files
authored
Merge pull request #5725 from Rageking8/structure-warning-references-in-range-c4521-c4560
Structure warning references in range [C4521, C4560]
2 parents bfab9ee + 543b05e commit 937735e

30 files changed

+185
-133
lines changed

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4526.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4526"
32
title: "Compiler Warning (level 1) C4526"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4526"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4526"]
66
helpviewer_keywords: ["C4526"]
7-
ms.assetid: 490f8916-5fdc-4cad-b412-76c3382a5976
87
---
98
# Compiler Warning (level 1) C4526
109

11-
'function' : static member function cannot override virtual function 'virtual function'override ignored, virtual function will be hidden
10+
> 'function' : static member function cannot override virtual function 'virtual function'override ignored, virtual function will be hidden
11+
12+
## Remarks
1213

1314
The static member function meets the criteria to override the virtual function, which makes the member function both virtual and static.
1415

16+
## Example
17+
1518
The following code generates C4526:
1619

1720
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4530.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
---
22
title: "Compiler Warning (level 1) C4530"
33
description: "Reference guide to Microsoft C++ compiler warning C4530."
4-
ms.date: "04/02/2020"
4+
ms.date: 04/02/2020
55
f1_keywords: ["C4530"]
66
helpviewer_keywords: ["C4530"]
7-
ms.assetid: a04dcdb2-84db-459d-9e5e-4e743887465f
87
---
98
# Compiler Warning (level 1) C4530
109

1110
> C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1211
13-
The code uses C++ exception handling, but [/EHsc](../../build/reference/eh-exception-handling-model.md) wasn't included in the compiler options.
14-
1512
## Remarks
1613

14+
The code uses C++ exception handling, but [/EHsc](../../build/reference/eh-exception-handling-model.md) wasn't included in the compiler options.
15+
1716
The compiler requires the **`/EHsc`** option to build C++ code that follows the C++ standard for exception handling. Standard C++ *unwind semantics* specifies that objects and stack frames constructed between where an exception is thrown and where it's caught must be destroyed and their resources recovered. This process is known as *unwinding the stack*.
1817

1918
The **`/EHsc`** option tells the compiler to generate code that calls the destructors on automatic storage objects when an exception passes through the containing stack frame. *Automatic storage* objects are objects allocated on the stack, such as local variables. It's called automatic storage because it's allocated automatically when functions are called, and released automatically when they return. A *stack frame* is the data placed on the stack when a function is called, along with its automatic storage.
@@ -26,7 +25,7 @@ If no exceptions can possibly be thrown in your executable, you may safely ignor
2625

2726
## Example
2827

29-
The following sample generates C4530:
28+
The following example generates C4530:
3029

3130
```cpp
3231
// C4530.cpp
@@ -36,4 +35,4 @@ int main() {
3635
}
3736
```
3837

39-
Compile the sample with **`/EHsc`** to resolve the warning.
38+
Compile the example with **`/EHsc`** to resolve the warning.

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4532.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4532"
32
title: "Compiler Warning (level 1) C4532"
3+
description: "Learn more about: Compiler Warning (level 1) C4532"
44
ms.date: 08/30/2022
55
f1_keywords: ["C4532"]
66
helpviewer_keywords: ["C4532"]
7-
ms.assetid: 4e2a286a-d233-4106-9f65-29be1a94ca02
87
---
98
# Compiler Warning (level 1) C4532
109

@@ -30,7 +29,7 @@ The [`/sdl` (Enable Additional Security Checks)](../../build/reference/sdl-enabl
3029

3130
## Example
3231

33-
The following sample generates C4532; delete or comment out the jump statements to resolve the warnings.
32+
The following example generates C4532; delete or comment out the jump statements to resolve the warnings.
3433

3534
```cpp
3635
// C4532.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4533.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4533"
32
title: "Compiler Warning (level 1) C4533"
3+
description: "Learn more about: Compiler Warning (level 1) C4533"
44
ms.date: 08/30/2022
55
f1_keywords: ["C4533"]
66
helpviewer_keywords: ["C4533"]
7-
ms.assetid: 359fecda-d540-46e5-b214-dbabe9ef50d2
87
---
98
# Compiler Warning (level 1) C4533
109

@@ -18,7 +17,7 @@ The [`/sdl` (Enable Additional Security Checks)](../../build/reference/sdl-enabl
1817

1918
## Example
2019

21-
The following sample generates C4533. To resolve the issue, move the initialization before the jump instruction or after the target of the jump.
20+
The following example generates C4533. To resolve the issue, move the initialization before the jump instruction or after the target of the jump.
2221

2322
```cpp
2423
// C4533.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4537.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4537"
32
title: "Compiler Warning (level 1) C4537"
4-
ms.date: "08/27/2018"
3+
description: "Learn more about: Compiler Warning (level 1) C4537"
4+
ms.date: 08/27/2018
55
f1_keywords: ["C4537"]
66
helpviewer_keywords: ["C4537"]
7-
ms.assetid: 9454493c-d419-475e-8f35-9c00233c9329
87
---
98
# Compiler Warning (level 1) C4537
109

@@ -16,7 +15,7 @@ A reference was passed where an object (user-defined type) was expected. A refer
1615

1716
## Example
1817

19-
The following sample generates C4537 and shows how to fix it:
18+
The following example generates C4537 and shows how to fix it:
2019

2120
```cpp
2221
// C4537.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4540.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4540"
32
title: "Compiler Warning (level 1) C4540"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4540"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4540"]
66
helpviewer_keywords: ["C4540"]
7-
ms.assetid: 8085e748-5f4d-43c2-b06d-eaf794edbf72
87
---
98
# Compiler Warning (level 1) C4540
109

11-
dynamic_cast used to convert to inaccessible or ambiguous base; run-time test will fail ('type1' to 'type2')
10+
> dynamic_cast used to convert to inaccessible or ambiguous base; run-time test will fail ('type1' to 'type2')
11+
12+
## Remarks
1213

1314
You used **`dynamic_cast`** to convert from one type to another. The compiler determined that the cast would always fail (return **NULL**) because a base class is inaccessible (**`private`**, for instance) or ambiguous (appears more than once in the class hierarchy, for instance).
1415

16+
## Example
17+
1518
The following shows an example of this warning. Class **B** is derived from class **A**. The program uses **`dynamic_cast`** to cast from class **B** (the derived class) to class **A**, which will always fail because class **B** is **`private`** and thus inaccessible. Changing the access of **A** to **`public`** will resolve the warning.
1619

1720
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4544.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4544"
32
title: "Compiler Warning (level 1) C4544"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4544"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4544"]
66
helpviewer_keywords: ["C4544"]
7-
ms.assetid: 11ee04df-41ae-435f-af44-881e801315a8
87
---
98
# Compiler Warning (level 1) C4544
109

11-
'declaration': Default template argument ignored on this template declaration
10+
> 'declaration': Default template argument ignored on this template declaration
11+
12+
## Remarks
1213

1314
A default template argument was specified in an incorrect location and was ignored. A default template argument for a class template can only be specified in the declaration or definition of the class template and not on a member of the class template.
1415

15-
This sample generates C4545, and the next sample shows how to fix it:
16+
## Example
17+
18+
This example generates C4545, and the next example shows how to fix it:
1619

1720
```cpp
1821
// C4544.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4545.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4545"
32
title: "Compiler Warning (level 1) C4545"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4545"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4545"]
66
helpviewer_keywords: ["C4545"]
7-
ms.assetid: 43f8f34f-ed46-4661-95c0-c588c577ff73
87
---
98
# Compiler Warning (level 1) C4545
109

11-
expression before comma evaluates to a function which is missing an argument list
10+
> expression before comma evaluates to a function which is missing an argument list
11+
12+
## Remarks
1213

1314
The compiler detected an ill-formed comma expression.
1415

1516
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1617

17-
The following sample generates C4545:
18+
## Example
19+
20+
The following example generates C4545:
1821

1922
```cpp
2023
// C4545.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4546.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4546"
32
title: "Compiler Warning (level 1) C4546"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4546"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4546"]
66
helpviewer_keywords: ["C4546"]
7-
ms.assetid: 071e1709-3841-46c1-8e71-96109cd22041
87
---
98
# Compiler Warning (level 1) C4546
109

11-
function call before comma missing argument list
10+
> function call before comma missing argument list
11+
12+
## Remarks
1213

1314
The compiler detected an ill-formed comma expression.
1415

1516
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1617

1718
## Example
1819

19-
The following sample generates C4546:
20+
The following example generates C4546:
2021

2122
```cpp
2223
// C4546.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4547.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4547"
32
title: "Compiler Warning (level 1) C4547"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4547"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4547"]
66
helpviewer_keywords: ["C4547"]
7-
ms.assetid: 3edf1c2e-c0d5-444d-ae83-44a7cce24bb2
87
---
98
# Compiler Warning (level 1) C4547
109

11-
'operator' : operator before comma has no effect; expected operator with side-effect
10+
> 'operator' : operator before comma has no effect; expected operator with side-effect
11+
12+
## Remarks
1213

1314
The compiler detected an ill-formed comma expression.
1415

1516
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1617

17-
The following sample generates C4547:
18+
## Example
19+
20+
The following example generates C4547:
1821

1922
```cpp
2023
// C4547.cpp

0 commit comments

Comments
 (0)