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,17 +1,20 @@
---
description: "Learn more about: Compiler Warning (level 1) C4526"
title: "Compiler Warning (level 1) C4526"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4526"
ms.date: 11/04/2016
f1_keywords: ["C4526"]
helpviewer_keywords: ["C4526"]
ms.assetid: 490f8916-5fdc-4cad-b412-76c3382a5976
---
# Compiler Warning (level 1) C4526

'function' : static member function cannot override virtual function 'virtual function'override ignored, virtual function will be hidden
> 'function' : static member function cannot override virtual function 'virtual function'override ignored, virtual function will be hidden

## Remarks

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

## Example

The following code generates C4526:

```cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
title: "Compiler Warning (level 1) C4530"
description: "Reference guide to Microsoft C++ compiler warning C4530."
ms.date: "04/02/2020"
ms.date: 04/02/2020
f1_keywords: ["C4530"]
helpviewer_keywords: ["C4530"]
ms.assetid: a04dcdb2-84db-459d-9e5e-4e743887465f
---
# Compiler Warning (level 1) C4530

> C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

The code uses C++ exception handling, but [/EHsc](../../build/reference/eh-exception-handling-model.md) wasn't included in the compiler options.

## Remarks

The code uses C++ exception handling, but [/EHsc](../../build/reference/eh-exception-handling-model.md) wasn't included in the compiler options.

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

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.
Expand All @@ -26,7 +25,7 @@ If no exceptions can possibly be thrown in your executable, you may safely ignor

## Example

The following sample generates C4530:
The following example generates C4530:

```cpp
// C4530.cpp
Expand All @@ -36,4 +35,4 @@ int main() {
}
```

Compile the sample with **`/EHsc`** to resolve the warning.
Compile the example with **`/EHsc`** to resolve the warning.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 1) C4532"
title: "Compiler Warning (level 1) C4532"
description: "Learn more about: Compiler Warning (level 1) C4532"
ms.date: 08/30/2022
f1_keywords: ["C4532"]
helpviewer_keywords: ["C4532"]
ms.assetid: 4e2a286a-d233-4106-9f65-29be1a94ca02
---
# Compiler Warning (level 1) C4532

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

## Example

The following sample generates C4532; delete or comment out the jump statements to resolve the warnings.
The following example generates C4532; delete or comment out the jump statements to resolve the warnings.

```cpp
// C4532.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 1) C4533"
title: "Compiler Warning (level 1) C4533"
description: "Learn more about: Compiler Warning (level 1) C4533"
ms.date: 08/30/2022
f1_keywords: ["C4533"]
helpviewer_keywords: ["C4533"]
ms.assetid: 359fecda-d540-46e5-b214-dbabe9ef50d2
---
# Compiler Warning (level 1) C4533

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

## Example

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

```cpp
// C4533.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 1) C4537"
title: "Compiler Warning (level 1) C4537"
ms.date: "08/27/2018"
description: "Learn more about: Compiler Warning (level 1) C4537"
ms.date: 08/27/2018
f1_keywords: ["C4537"]
helpviewer_keywords: ["C4537"]
ms.assetid: 9454493c-d419-475e-8f35-9c00233c9329
---
# Compiler Warning (level 1) C4537

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

## Example

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

```cpp
// C4537.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
---
description: "Learn more about: Compiler Warning (level 1) C4540"
title: "Compiler Warning (level 1) C4540"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4540"
ms.date: 11/04/2016
f1_keywords: ["C4540"]
helpviewer_keywords: ["C4540"]
ms.assetid: 8085e748-5f4d-43c2-b06d-eaf794edbf72
---
# Compiler Warning (level 1) C4540

dynamic_cast used to convert to inaccessible or ambiguous base; run-time test will fail ('type1' to 'type2')
> dynamic_cast used to convert to inaccessible or ambiguous base; run-time test will fail ('type1' to 'type2')

## Remarks

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

## Example

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.

```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) C4544"
title: "Compiler Warning (level 1) C4544"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4544"
ms.date: 11/04/2016
f1_keywords: ["C4544"]
helpviewer_keywords: ["C4544"]
ms.assetid: 11ee04df-41ae-435f-af44-881e801315a8
---
# Compiler Warning (level 1) C4544

'declaration': Default template argument ignored on this template declaration
> 'declaration': Default template argument ignored on this template declaration

## Remarks

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.

This sample generates C4545, and the next sample shows how to fix it:
## Example

This example generates C4545, and the next example shows how to fix it:

```cpp
// C4544.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1) C4545"
title: "Compiler Warning (level 1) C4545"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4545"
ms.date: 11/04/2016
f1_keywords: ["C4545"]
helpviewer_keywords: ["C4545"]
ms.assetid: 43f8f34f-ed46-4661-95c0-c588c577ff73
---
# Compiler Warning (level 1) C4545

expression before comma evaluates to a function which is missing an argument list
> expression before comma evaluates to a function which is missing an argument list

## Remarks

The compiler detected an ill-formed comma expression.

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

The following sample generates C4545:
## Example

The following example generates C4545:

```cpp
// C4545.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1) C4546"
title: "Compiler Warning (level 1) C4546"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4546"
ms.date: 11/04/2016
f1_keywords: ["C4546"]
helpviewer_keywords: ["C4546"]
ms.assetid: 071e1709-3841-46c1-8e71-96109cd22041
---
# Compiler Warning (level 1) C4546

function call before comma missing argument list
> function call before comma missing argument list

## Remarks

The compiler detected an ill-formed comma expression.

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

## Example

The following sample generates C4546:
The following example generates C4546:

```cpp
// C4546.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1) C4547"
title: "Compiler Warning (level 1) C4547"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4547"
ms.date: 11/04/2016
f1_keywords: ["C4547"]
helpviewer_keywords: ["C4547"]
ms.assetid: 3edf1c2e-c0d5-444d-ae83-44a7cce24bb2
---
# Compiler Warning (level 1) C4547

'operator' : operator before comma has no effect; expected operator with side-effect
> 'operator' : operator before comma has no effect; expected operator with side-effect

## Remarks

The compiler detected an ill-formed comma expression.

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

The following sample generates C4547:
## Example

The following example generates C4547:

```cpp
// C4547.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1) C4548"
title: "Compiler Warning (level 1) C4548"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4548"
ms.date: 11/04/2016
f1_keywords: ["C4548"]
helpviewer_keywords: ["C4548"]
ms.assetid: 2cee817e-e463-4d90-bbd2-de120d48c101
---
# Compiler Warning (level 1) C4548

expression before comma has no effect; expected expression with side-effect
> expression before comma has no effect; expected expression with side-effect

## Remarks

The compiler detected an ill-formed comma expression.

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

The following sample generates C4548:
## Example

The following example generates C4548:

```cpp
// C4548.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1) C4549"
title: "Compiler Warning (level 1) C4549"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4549"
ms.date: 11/04/2016
f1_keywords: ["C4549"]
helpviewer_keywords: ["C4549"]
ms.assetid: 81a07676-625b-4f58-9b0c-3ee22830b04a
---
# Compiler Warning (level 1) C4549

'operator' : operator before comma has no effect; did you intend 'operator'?
> 'operator' : operator before comma has no effect; did you intend 'operator'?

## Remarks

The compiler detected an ill-formed comma expression.

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

The following sample generates C4549:
## Example

The following example generates C4549:

```cpp
// C4549.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
description: "Learn more about: Compiler Warning (level 1) C4550"
title: "Compiler Warning (level 1) C4550"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4550"
ms.date: 11/04/2016
f1_keywords: ["C4550"]
helpviewer_keywords: ["C4550"]
ms.assetid: f902b4ed-5f17-48ea-b693-92f4fb8c8054
---
# Compiler Warning (level 1) C4550

expression evaluates to a function which is missing an argument list
> expression evaluates to a function which is missing an argument list

## Remarks

A dereferenced pointer to a function is missing an argument list.

## Example

The following example generates C4550:

```cpp
// C4550.cpp
// compile with: /W1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4551"
title: "Compiler Warning (level 1) C4551"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4551"
ms.date: 11/04/2016
f1_keywords: ["C4551"]
helpviewer_keywords: ["C4551"]
ms.assetid: 458b59bd-e2d7-425f-9ba6-268ff200424f
---
# Compiler Warning (level 1) C4551

function call missing argument list
> function call missing argument list

## Remarks

A function call must include the open and close parentheses after the function name even if the function takes no parameters.

The following sample generates C4551:
## Example

The following example generates C4551:

```cpp
// C4551.cpp
Expand Down
Loading