Skip to content

Commit 3b00b28

Browse files
authored
Merge pull request #5745 from MicrosoftDocs/main
1/24/2025 AM Publish
2 parents 10f8c99 + eea2d8f commit 3b00b28

15 files changed

+519
-512
lines changed
Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,51 @@
11
---
2-
description: "Learn more about: Compiler Warning C4430"
3-
title: "Compiler Warning C4430"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Compiler Warning (level 1, error) C4430"
3+
title: "Compiler warning (level 1, error) C4430"
4+
ms.date: "1/25/2025"
55
f1_keywords: ["C4430"]
66
helpviewer_keywords: ["C4430"]
7-
ms.assetid: 12efbfff-aa58-4a86-a7d6-2c6a12d01dd3
87
---
9-
# Compiler Warning C4430
8+
# Compiler Warning (level 1, Error) C4430
109

11-
missing type specifier - int assumed. Note: C++ does not support default-int
10+
> missing type specifier - int assumed. Note: C++ does not support default-int
1211
13-
This error can be generated as a result of compiler conformance work that was done for Visual Studio 2005: all declarations must explicitly specify the type; int is no longer assumed.
12+
This error might be generated due to compiler conformance work done for Visual Studio 2005: all declarations must explicitly specify the type; `int` is no longer assumed.
1413

15-
C4430 is always issued as an error. You can turn off this warning with the `#pragma warning` or **/wd**; see [warning](../../preprocessor/warning.md) or [/w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning Level)](../../build/reference/compiler-option-warning-level.md) for more information.
14+
C4430 is always issued as an error. You can turn off this warning with the `#pragma warning` or `/wd`. For more information, see [`warning`](../../preprocessor/warning.md) or [`/w`, `/W0`, `/W1`, `/W2`, `/W3`, `/W4`, `/w1`, `/w2`, `/w3`, `/w4`, `/Wall`, `/wd`, `/we`, `/wo`, `/Wv`, `/WX` (Warning Level)](../../build/reference/compiler-option-warning-level.md).
1615

1716
## Example
1817

19-
The following sample generates C4430.
18+
The following sample generates C4430:
2019

2120
```cpp
22-
// C4430.cpp
2321
// compile with: /c
2422
struct CMyClass {
2523
CUndeclared m_myClass; // C4430
26-
int m_myClass; // OK
24+
int m_myClass;
2725
};
2826

2927
typedef struct {
30-
POINT(); // C4430
31-
// try the following line instead
32-
// int POINT();
28+
someFunction(); // C4430
3329
unsigned x;
3430
unsigned y;
3531
} POINT;
3632
```
33+
34+
The following addresses C4430:
35+
36+
```cpp
37+
// compile with: /c
38+
39+
#include "CUndeclared.h" // for `CUndeclared`
40+
41+
struct CMyClass {
42+
CUndeclared m_myClass;
43+
int m_myClass;
44+
};
45+
46+
typedef struct {
47+
int someFunction();
48+
unsigned x;
49+
unsigned y;
50+
} POINT;
51+
```

docs/error-messages/compiler-warnings/compiler-warning-c4439.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Warning C4439"
3-
title: "Compiler Warning C4439"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Compiler Warning (level 1, error) C4439"
3+
title: "Compiler warning (level 1, error) C4439"
4+
ms.date: "1/22/2025"
55
f1_keywords: ["C4439"]
66
helpviewer_keywords: ["C4439"]
7-
ms.assetid: 9449958f-f407-4824-829b-9e092f2af97d
87
---
9-
# Compiler Warning C4439
8+
# Compiler warning C4439
109

11-
'function' : function definition with a managed type in the signature must have a __clrcall calling convention
10+
> '*function name*': function definition with a managed type in the signature must have a `__clrcall` calling convention
1211
1312
The compiler implicitly replaced a calling convention with [`__clrcall`](../../cpp/clrcall.md). To resolve this warning, remove the **`__cdecl`** or **`__stdcall`** calling convention.
1413

15-
C4439 is always issued as an error. You can turn off this warning with the `#pragma warning` or **`/wd`**; see [warning](../../preprocessor/warning.md) or [/w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning Level)](../../build/reference/compiler-option-warning-level.md) for more information.
14+
C4439 is always issued as an error. You can turn off this warning with the `#pragma warning` or **`/wd`**. For more information, see [`warning`](../../preprocessor/warning.md) or [`/w`, `/W0`, `/W1`, `/W2`, `/W3`, `/W4`, `/w1`, `/w2`, `/w3`, `/w4`, `/Wall`, `/wd`, `/we`, `/wo`, `/Wv`, `/WX` (Warning Level)](../../build/reference/compiler-option-warning-level.md).
1615

1716
## Example
1817

19-
The following sample generates C4439.
18+
The following sample generates C4439:
2019

2120
```cpp
2221
// C4439.cpp

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

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4436"
3-
title: "Compiler Warning (level 1) C4436"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Compiler Warning (level 1 and level 4) C4436"
3+
title: "Compiler warning (level 1 and level 4) C4436"
4+
ms.date: "1/22/2025"
55
f1_keywords: ["C4436"]
66
helpviewer_keywords: ["C4436"]
7-
ms.assetid: 2b54a1fc-c9c6-4cc9-90be-faa44fc715d5
87
---
9-
# Compiler Warning (level 1) C4436
8+
# Compiler warning (level 1) C4436
109

11-
dynamic_cast from virtual base 'class1' to 'class2' in constructor or destructor could fail with partially-constructed object Compile with /vd2 or define 'class2' with #pragma vtordisp(2) in effect
10+
> `dynamic_cast` from virtual base '*base_class*' to '*derived_class*' in constructor or destructor could fail with partially-constructed object
1211
13-
The compiler has encountered a **`dynamic_cast`** operation with the following characteristics.
12+
A `dynamic_cast` operation is used when:
1413

1514
- The cast is from a base class pointer to a derived class pointer.
16-
1715
- The derived class virtually inherits the base class.
16+
- The derived class doesn't have a `vtordisp` field for the virtual base.
17+
- The cast is found in a constructor or destructor of the derived class, or a class that inherits from the derived class.
1818

19-
- The derived class does not have a `vtordisp` field for the virtual base.
20-
21-
- The cast is found in a constructor or destructor of the derived class, or some class which further inherits from the derived class.
22-
23-
The warning indicates the **`dynamic_cast`** might not perform correctly, if it is operating on a partially-constructed object. That happens if the derived constructor/destructor is operating on a sub-object of some further derived object. If the derived class named in the warning is never further derived, the warning can be ignored.
19+
This warning indicates that the `dynamic_cast` might not perform correctly if it is applied to a partially constructed object. Which happens if the derived constructor/destructor is operating on a subobject of some further derived object. If the derived class named in the warning isn't further derived, you can ignore the warning.
2420

2521
## Example
2622

27-
The following sample generates C4436 and demonstrates the code generation issue that arises from the missing `vtordisp` field.
23+
The following sample generates C4436 and demonstrates the code generation issue due to the missing `vtordisp` field:
2824

2925
```cpp
3026
// C4436.cpp
3127
// To see the warning and runtime assert, compile with: /W1
32-
// To eliminate the warning and assert, compile with: /W1 /vd2
28+
// To eliminate the warning and assert, compile with: /W1 /vd2
3329
// or compile with: /W1 /DFIX
3430
#include <cassert>
3531

@@ -48,7 +44,7 @@ struct B : virtual A
4844
{
4945
A* a = static_cast<A*>(this);
5046
B* b = dynamic_cast<B*>(a); // C4436
51-
assert(this == b); // assert unless compiled with /vd2
47+
assert(this == b); // asserts unless compiled with /vd2
5248
}
5349
};
5450
#if defined(FIX)
@@ -68,6 +64,6 @@ int main()
6864
6965
## See also
7066
71-
[dynamic_cast Operator](../../cpp/dynamic-cast-operator.md)<br/>
72-
[vtordisp](../../preprocessor/vtordisp.md)<br/>
73-
[Compiler Warning (level 4) C4437](../../error-messages/compiler-warnings/compiler-warning-level-4-c4437.md)
67+
[`dynamic_cast` Operator](../../cpp/dynamic-cast-operator.md)\
68+
[`vtordisp`](../../preprocessor/vtordisp.md)\
69+
[Compiler Warning (level 1 and level 4, off) C4437](compiler-warning-level-4-c4437.md)

docs/error-messages/compiler-warnings/compiler-warning-level-2-c4412.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 2) C4412"
3-
title: "Compiler Warning (level 2) C4412"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Compiler Warning (level 2, off) C4412"
3+
title: "Compiler warning (level 2, off) C4412"
4+
ms.date: "1/22/2025"
55
f1_keywords: ["C4412"]
66
helpviewer_keywords: ["C4412"]
7-
ms.assetid: f28dc531-1a98-497b-a366-0a13e1bc81c7
87
---
9-
# Compiler Warning (level 2) C4412
8+
# Compiler warning (level 2, off) C4412
109

11-
> '*function*' : function signature contains type '*type*'; C++ objects are unsafe to pass between pure code and mixed or native.
10+
> '*function*': function signature contains type '*type*'; C++ objects are unsafe to pass between pure code and mixed or native.
1211
1312
## Remarks
1413

15-
The **/clr:pure** compiler option is deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017. If you have code that needs to be pure, we recommend that you port it to C#.
14+
The `/clr:pure` compiler option is deprecated in Visual Studio 2015, and unsupported starting in Visual Studio 2017. If you have code that needs to be CLR pure, we recommend that you port it to C#.
1615

17-
The compiler detected a potentially unsafe situation that could result in a runtime error: a call is being made from a **/clr:pure** compiland to a function that was imported via dllimport and the function signature contains an unsafe type. A type is unsafe if it contains a member function or has a data member that is an unsafe type or an indirection to an unsafe type.
16+
The compiler detected a potentially unsafe situation that could result in a runtime error: a call is being made from code compiled with `/clr:pure` to a function imported via `dllimport`, and the function signature contains an unsafe type. A type is unsafe if it contains a member function or has a data member that is an unsafe type or an indirection to an unsafe type.
1817

19-
This is unsafe because of the difference in the default calling conventions between pure and native code (or mixed native and managed). When importing (via `dllimport`) a function into a **/clr:pure** compiland, ensure that the declarations of each type in the signature are identical to those in the compiland that exports the function (being especially careful about differences in implicit calling conventions).
18+
This pattern is unsafe because of the difference in the default calling conventions between pure and native code (or mixed native and managed). When importing a function via `dllimport` into code compiled with `/clr:pure`, ensure that the declarations of each type in the signature are identical to the signature in the compiland that exports the function (being especially careful about differences in implicit calling conventions).
2019

21-
A virtual member function is especially prone to give unexpected results. However, even a non-virtual function should be tested to ensure that you get the correct results. If you are sure that you are getting the correct results, you can ignore this warning.
20+
A virtual member function is especially prone to give unexpected results. However, even a nonvirtual function should be tested to ensure that you get the correct results. This warning can be ignored once you ensure the result is correct.
2221

23-
C4412 is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) and [dllexport, dllimport](../../cpp/dllexport-dllimport.md) for more information.
22+
C4412 is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) and [`dllexport`, `dllimport`](../../cpp/dllexport-dllimport.md).
2423

2524
To resolve this warning, remove all functions from the type.
2625

27-
## Examples
26+
## Example
2827

29-
The following sample generates C4412.
28+
The following sample generates C4412:
3029

3130
```cpp
32-
// C4412.cpp
3331
// compile with: /c /W2 /clr:pure
3432
#pragma warning (default : 4412)
3533

@@ -52,7 +50,7 @@ int main() {
5250
}
5351
```
5452
55-
The following sample is a header file that declares two types. The `Unsafe` type is unsafe because it has a member function.
53+
The following sample is a header file that declares two types. The `Unsafe` type is unsafe because it has a member function:
5654
5755
```cpp
5856
// C4412.h
@@ -70,7 +68,7 @@ struct Safe {
7068
};
7169
```
7270

73-
This sample exports functions with the types defined in the header file.
71+
This sample exports functions with the types defined in the header file:
7472

7573
```cpp
7674
// C4412_2.cpp
@@ -85,9 +83,9 @@ __declspec(dllexport) Unsafe * __cdecl func() { return new Unsafe; }
8583
__declspec(dllexport) Safe * __cdecl func2() { return new Safe; }
8684
```
8785
88-
The default calling convention in a **/clr:pure** compilation is different from a native compilation. When C4412.h is included, `Test` defaults to `__clrcall`. If you compile and run this program (do not use **/c**), the program will throw an exception.
86+
The default calling convention in a `/clr:pure` compilation is different from a native compilation. When `C4412.h` is included, `Test` defaults to `__clrcall`.
8987
90-
The following sample generates C4412.
88+
The following sample generates C4412 and throws an exception at runtime:
9189
9290
```cpp
9391
// C4412_3.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4400.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4400"
3-
title: "Compiler Warning (level 4) C4400"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Compiler Warning (level 4, error) C4400"
3+
title: "Compiler warning (level 4, error) C4400"
4+
ms.date: "1/22/2025"
55
f1_keywords: ["C4400"]
66
helpviewer_keywords: ["C4400"]
7-
ms.assetid: f135fe98-4f92-4e07-9d71-2621b36ee755
87
---
9-
# Compiler Warning (level 4) C4400
8+
# Compiler warning (level 4, error) C4400
109

11-
'type' : const/volatile qualifiers on this type are not supported
10+
> '*type*': `const`/`volatile` qualifiers on this type are not supported
1211
13-
The [const](../../cpp/const-cpp.md)and [volatile](../../cpp/volatile-cpp.md)qualifiers will not work with variables of common language runtime types.
12+
The [`const`](../../cpp/const-cpp.md) and [`volatile`](../../cpp/volatile-cpp.md) qualifiers don't work with common language runtime typed variables.
1413

1514
## Example
1615

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4435.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4435"
3-
title: "Compiler Warning (level 4) C4435"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Compiler Warning (level 4, off) C4435"
3+
title: "Compiler Warning (level 4, off) C4435"
4+
ms.date: "1/22/2025"
55
f1_keywords: ["C4435"]
66
helpviewer_keywords: ["C4435"]
7-
ms.assetid: a04524af-2b71-4ff9-9729-d9d1d1904ed7
87
---
9-
# Compiler Warning (level 4) C4435
8+
# Compiler warning (level 4, off) C4435
109

11-
'class1' : Object layout under /vd2 will change due to virtual base 'class2'
10+
> '*derived_class*': Object layout under `/vd2` will change due to virtual base '*base_class*'
1211
13-
This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
12+
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).
1413

15-
Under the default compile option of /vd1, the derived class does not have a `vtordisp` field for the indicated virtual base. If /vd2 or `#pragma vtordisp(2)` is in effect, a `vtordisp` field will be present, changing the object layout. This can lead to binary compatibility problems if interacting modules are compiled with different `vtordisp` settings.
14+
Under the default compile option of `/vd1`, the derived class doesn't have a `vtordisp` field for the indicated virtual base. If `/vd2` or `#pragma vtordisp(2)` is in effect, a `vtordisp` field is present, changing the object layout. This difference can lead to binary compatibility problems if interacting modules are compiled with different `vtordisp` settings.
1615

1716
## Example
1817

@@ -34,5 +33,5 @@ class B : public virtual A // C4435
3433

3534
## See also
3635

37-
[vtordisp](../../preprocessor/vtordisp.md)<br/>
38-
[/vd (Disable Construction Displacements)](../../build/reference/vd-disable-construction-displacements.md)
36+
[`vtordisp`](../../preprocessor/vtordisp.md)\
37+
[`/vd` (Disable Construction Displacements)](../../build/reference/vd-disable-construction-displacements.md)

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4437.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4437"
3-
title: "Compiler Warning (level 4) C4437"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Compiler Warning (level 1 and level 4, off) C4437"
3+
title: "Compiler warning (level 1 and level 4, off) C4437"
4+
ms.date: "1/22/2025"
55
f1_keywords: ["C4437"]
66
helpviewer_keywords: ["C4437"]
7-
ms.assetid: dc07e350-20eb-474c-a7ad-f841ae7ec339
87
---
9-
# Compiler Warning (level 4) C4437
8+
# Compiler warning (level 1 and level 4, off) C4437
109

11-
dynamic_cast from virtual base 'class1' to 'class2' could fail in some contexts Compile with /vd2 or define 'class2' with #pragma vtordisp(2) in effect
10+
> `dynamic_cast` from virtual base '*base_class*' to '*derived_class*' could fail in some contexts
1211
13-
This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
12+
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).
1413

15-
The compiler has encountered a **`dynamic_cast`** operation with the following characteristics.
14+
A `dynamic_cast` operation is used when:
1615

1716
- The cast is from a base class pointer to a derived class pointer.
18-
1917
- The derived class virtually inherits the base class.
18+
- The derived class doesn't have a `vtordisp` field for the virtual base.
19+
- The cast is found in a constructor or destructor of the derived class, or a class that inherits from the derived class. Otherwise, compiler warning [C4436](compiler-warning-level-1-c4436.md) is emitted issued of C4435.
2020

21-
- The derived class does not have a `vtordisp` field for the virtual base.
22-
23-
- The cast is not found in a constructor or destructor of the derived class, or some class which further inherits from the derived class (otherwise, compiler warning C4436 will be issued).
24-
25-
The warning indicates that the **`dynamic_cast`** might not perform correctly if it is operating on a partially-constructed object. This situation occurs when the enclosing function is called from a constructor or destructor of a class that inherits the derived class that is named in the warning. If the derived class that is named in the warning is never further derived, or the enclosing function is not called during object construction or destruction, the warning can be ignored.
21+
This warning indicates that the `dynamic_cast` might not perform correctly when applied to a partially constructed object. This situation occurs when the enclosing function is called from a constructor or destructor of a class that inherits from *derived_class*. You can ignore the error if *derived_class* is never further derived, or the enclosing function isn't called during object construction or destruction.
2622

2723
## Example
2824

29-
The following sample generates C4437 and demonstrates the code generation issue that arises from the missing `vtordisp` field.
25+
The following sample generates C4437 and demonstrates the code generation issue that arises from the missing `vtordisp` field:
3026

3127
```cpp
3228
// C4437.cpp
@@ -76,6 +72,6 @@ int main()
7672
7773
## See also
7874
79-
[dynamic_cast Operator](../../cpp/dynamic-cast-operator.md)<br/>
80-
[vtordisp](../../preprocessor/vtordisp.md)<br/>
81-
[Compiler Warning (level 1) C4436](../../error-messages/compiler-warnings/compiler-warning-level-1-c4436.md)
75+
[`dynamic_cast` Operator](../../cpp/dynamic-cast-operator.md)\
76+
[`vtordisp`](../../preprocessor/vtordisp.md)\
77+
[Compiler Warning (level 1) C4436](compiler-warning-level-1-c4436.md)

0 commit comments

Comments
 (0)