Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: Compiler Warning (level 1, error) C4430"
title: "Compiler warning (level 1, error) C4430"
description: "Learn more about: Compiler Warning (level 1, error) C4430"
ms.date: 04/22/2025
f1_keywords: ["C4430"]
helpviewer_keywords: ["C4430"]
Expand All @@ -9,13 +9,15 @@ helpviewer_keywords: ["C4430"]

> missing type specifier - int assumed. Note: C++ does not support default-int

## Remarks

This warning is issued when a type specifier is missing in a declaration. The compiler used to assume the type was `int` in this case. But due to compiler conformance work done for Visual Studio 2005, all declarations must explicitly specify the type.

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).

## Example

The following sample generates C4430:
The following example generates C4430:

```cpp
// compile with: /c
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1, error) C4439"
title: "Compiler warning (level 1, error) C4439"
ms.date: "1/22/2025"
description: "Learn more about: Compiler Warning (level 1, error) C4439"
ms.date: 1/22/2025
f1_keywords: ["C4439"]
helpviewer_keywords: ["C4439"]
---
# Compiler warning C4439

> '*function name*': function definition with a managed type in the signature must have a `__clrcall` calling convention

## Remarks

The compiler implicitly replaced a calling convention with [`__clrcall`](../../cpp/clrcall.md). To resolve this warning, remove the **`__cdecl`** or **`__stdcall`** calling convention.

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).

## Example

The following sample generates C4439:
The following example generates C4439:

```cpp
// C4439.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1) C4401"
title: "Compiler Warning (level 1) C4401"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4401"
ms.date: 11/04/2016
f1_keywords: ["C4401"]
helpviewer_keywords: ["C4401"]
ms.assetid: 2e7ca136-f144-4b40-b847-82976e8643fc
---
# Compiler Warning (level 1) C4401

'bitfield' : member is bit field
> 'bitfield' : member is bit field

## Remarks

Inline assembly code tries to access a bit-field member. Inline assembly cannot access bit-field members, so the last packing boundary before the bit-field member is used.

To avoid this warning, cast the bit field to an appropriate type before making the reference in inline assembly code. The following sample generates C4401:
To avoid this warning, cast the bit field to an appropriate type before making the reference in inline assembly code.

## Example

The following example generates C4401:

```cpp
// C4401.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Warning (level 1) C4402"
title: "Compiler Warning (level 1) C4402"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4402"
ms.date: 11/04/2016
f1_keywords: ["C4402"]
helpviewer_keywords: ["C4402"]
ms.assetid: 2aaecfae-1e79-4787-87e8-0973f7ec0efe
---
# Compiler Warning (level 1) C4402

must use PTR operator
> must use PTR operator

## Remarks

A type is used on an operand without a PTR operator when referring to or casting to a type in inline assembly code.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Warning (level 1) C4403"
title: "Compiler Warning (level 1) C4403"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4403"
ms.date: 11/04/2016
f1_keywords: ["C4403"]
helpviewer_keywords: ["C4403"]
ms.assetid: d95597c9-4762-4f33-86e4-1d98f0e80d52
---
# Compiler Warning (level 1) C4403

illegal PTR operator
> illegal PTR operator

## Remarks

A PTR operator is used inappropriately in inline assembler code.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4405"
title: "Compiler Warning (level 1) C4405"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4405"
ms.date: 11/04/2016
f1_keywords: ["C4405"]
helpviewer_keywords: ["C4405"]
ms.assetid: 155c64d6-58ae-4455-b61f-ccd711c5da96
---
# Compiler Warning (level 1) C4405

'identifier' : identifier is reserved word
> 'identifier' : identifier is reserved word

## Remarks

A word reserved for inline assembly is used as a variable name. This may cause unpredictable results. To fix this warning, avoid naming variables with words reserved for inline assembly.

## Example

A word reserved for inline assembly is used as a variable name. This may cause unpredictable results. To fix this warning, avoid naming variables with words reserved for inline assembly. The following sample generates C4405:
The following example generates C4405:

```cpp
// C4405.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Warning (level 1) C4406"
title: "Compiler Warning (level 1) C4406"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4406"
ms.date: 11/04/2016
f1_keywords: ["C4406"]
helpviewer_keywords: ["C4406"]
ms.assetid: a3204731-2285-401c-b73b-af98586a86fa
---
# Compiler Warning (level 1) C4406

operand on directive ignored
> operand on directive ignored

## Remarks

The directive does not take any operands, but an operand was specified.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: Compiler Warning (level 1) C4407"
title: "Compiler Warning (level 1) C4407"
description: "Learn more about: Compiler Warning (level 1) C4407"
ms.date: 04/13/2021
f1_keywords: ["C4407"]
helpviewer_keywords: ["C4407"]
Expand All @@ -9,17 +9,17 @@ helpviewer_keywords: ["C4407"]

> cast between different pointer to member representations, compiler may generate incorrect code

An incorrect cast between pointer-to-member types was detected.

## Remarks

An incorrect cast between pointer-to-member types was detected.

C4407 can be generated because of compiler conformance work that was done in Visual Studio 2005. Pointer-to-member now requires a qualified name and the address-of operator (&).

C4407 can occur if you cast between a multiple inheritance pointer-to-member to a single inheritance pointer-to-member. Sometimes this can work, but sometimes it can't because the single inheritance pointer-to-member representation doesn't hold sufficient information. Compiling with the **`/vmm`** might help. For more information, see [`/vmm`, `/vms`, `/vmv` (General purpose representation)](../../build/reference/vmm-vms-vmv-general-purpose-representation.md). You can also try rearranging your base classes; the compiler is detecting a loss of information in the conversion because a base class is at a non-zero offset from the derived.

## Example

The following sample generates C4407 and shows how to fix it:
The following example generates C4407 and shows how to fix it:

```cpp
// C4407.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4409"
title: "Compiler Warning (level 1) C4409"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4409"
ms.date: 11/04/2016
f1_keywords: ["C4409"]
helpviewer_keywords: ["C4409"]
ms.assetid: 2be63c86-d9c9-4073-ab71-e654dd9f450f
---
# Compiler Warning (level 1) C4409

illegal instruction size
> illegal instruction size

## Remarks

The instruction did not have a form with the specified size. The smallest legal size was used.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4410"
title: "Compiler Warning (level 1) C4410"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4410"
ms.date: 11/04/2016
f1_keywords: ["C4410"]
helpviewer_keywords: ["C4410"]
ms.assetid: 7dcdb720-118a-4823-ba73-575f6ad79a71
---
# Compiler Warning (level 1) C4410

illegal size for operand
> illegal size for operand

## Remarks

One of the operands on the instruction had an incorrect size. The smallest legal size for the operand was used.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4411"
title: "Compiler Warning (level 1) C4411"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4411"
ms.date: 11/04/2016
f1_keywords: ["C4411"]
helpviewer_keywords: ["C4411"]
ms.assetid: d209452c-83bd-4333-8d0b-759ca9b4864e
---
# Compiler Warning (level 1) C4411

'identifier' : symbol resolves to displacement register
> 'identifier' : symbol resolves to displacement register

## Remarks

The identifier is a local symbol that resolves to a displacement register and therefore may be used on an operand with another symbol.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Warning (level 1) C4420"
title: "Compiler Warning (level 1) C4420"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4420"
ms.date: 11/04/2016
f1_keywords: ["C4420"]
helpviewer_keywords: ["C4420"]
ms.assetid: 44a37754-7ddd-4764-a5f7-d33e05c20091
---
# Compiler Warning (level 1) C4420

'operator' : operator not available, using 'operator' instead; run-time checking may be compromised
> 'operator' : operator not available, using 'operator' instead; run-time checking may be compromised

## Remarks

This warning is generated when you use the [/RTCv](../../build/reference/rtc-run-time-error-checks.md) (vector new/delete checking) and when no vector form is found. In this case, the non-vector form is used.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
description: "Learn more about: Compiler Warning (level 1 and level 4) C4436"
title: "Compiler warning (level 1 and level 4) C4436"
ms.date: "1/22/2025"
description: "Learn more about: Compiler Warning (level 1 and level 4) C4436"
ms.date: 1/22/2025
f1_keywords: ["C4436"]
helpviewer_keywords: ["C4436"]
---
# Compiler warning (level 1) C4436

> `dynamic_cast` from virtual base '*base_class*' to '*derived_class*' in constructor or destructor could fail with partially-constructed object

## Remarks

A `dynamic_cast` operation is used when:

- The cast is from a base class pointer to a derived class pointer.
Expand All @@ -20,7 +22,7 @@ This warning indicates that the `dynamic_cast` might not perform correctly if it

## Example

The following sample generates C4436 and demonstrates the code generation issue due to the missing `vtordisp` field:
The following example generates C4436 and demonstrates the code generation issue due to the missing `vtordisp` field:

```cpp
// C4436.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4440"
title: "Compiler Warning (level 1) C4440"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4440"
ms.date: 11/04/2016
f1_keywords: ["C4440"]
helpviewer_keywords: ["C4440"]
ms.assetid: 78b9642a-a93e-401e-9d92-372f6451bc5d
---
# Compiler Warning (level 1) C4440

calling convention redefinition from 'calling_convention1' to 'calling_convention2' ignored
> calling convention redefinition from 'calling_convention1' to 'calling_convention2' ignored

## Remarks

An attempt to change the calling convention was ignored.

The following sample generates C4440:
## Example

The following example generates C4440:

```cpp
// C4440.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4441"
title: "Compiler Warning (level 1) C4441"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4441"
ms.date: 11/04/2016
f1_keywords: ["C4441"]
helpviewer_keywords: ["C4441"]
ms.assetid: 7fc540a5-e41f-47cf-aa37-b2b699c2685e
---
# Compiler Warning (level 1) C4441

calling convention of 'cc1' ignored; 'cc2' used instead
> calling convention of 'cc1' ignored; 'cc2' used instead

## Remarks

Member functions in managed user-defined types and global function generics must use the [__clrcall](../../cpp/clrcall.md) calling convention. The compiler used `__clrcall`.

## Example

The following sample generates C4441.
The following example generates C4441.

```cpp
// C4441.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4445"
title: "Compiler Warning (level 1) C4445"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4445"
ms.date: 11/04/2016
f1_keywords: ["C4445"]
helpviewer_keywords: ["C4445"]
ms.assetid: 535e92a0-ba08-4dfc-89b2-af2dcdd7caeb
---
# Compiler Warning (level 1) C4445

'function' : in a WinRT or managed type a virtual method cannot be private
> 'function' : in a WinRT or managed type a virtual method cannot be private

## Remarks

If a virtual function is private, it cannot be accessed by a derived type. To fix this error, change the accessibility of the virtual member function to protected or public.
Loading