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,19 +1,22 @@
---
description: "Learn more about: Compiler Warning (level 1) C4081"
title: "Compiler Warning (level 1) C4081"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4081"
ms.date: 11/04/2016
f1_keywords: ["C4081"]
helpviewer_keywords: ["C4081"]
ms.assetid: 6f656373-a080-4989-bbc9-e2f894b03293
---
# Compiler Warning (level 1) C4081

expected 'token1'; found 'token2'
> expected 'token1'; found 'token2'

## Remarks

The compiler expected a different token in this context.

## Example

The following example generates C4081:

```cpp
// C4081.cpp
// compile with: /W1 /LD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
description: "Learn more about: Compiler Warning (level 1) C4083"
title: "Compiler Warning (level 1) C4083"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4083"
ms.date: 11/04/2016
f1_keywords: ["C4083"]
helpviewer_keywords: ["C4083"]
ms.assetid: e7d3344e-5645-4d56-8460-d1acc9145ada
---
# Compiler Warning (level 1) C4083

expected 'token'; found identifier 'identifier'
> expected 'token'; found identifier 'identifier'

## Remarks

An identifier occurs in the wrong place in a **#pragma** statement.

## Example

The following example generates C4083:

```cpp
// C4083.cpp
// compile with: /W1 /LD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4085"
title: "Compiler Warning (level 1) C4085"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4085"
ms.date: 11/04/2016
f1_keywords: ["C4085"]
helpviewer_keywords: ["C4085"]
ms.assetid: 2bc6eb25-058f-4597-b351-fd69587b5170
---
# Compiler Warning (level 1) C4085

expected pragma parameter to be 'on' or 'off'
> expected pragma parameter to be 'on' or 'off'

## Remarks

The pragma requires an **on** or **off** parameter. The pragma is ignored.

The following sample generates C4085:
## Example

The following example generates C4085:

```cpp
// C4085.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) C4086"
title: "Compiler Warning (level 1) C4086"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4086"
ms.date: 11/04/2016
f1_keywords: ["C4086"]
helpviewer_keywords: ["C4086"]
ms.assetid: 9248831b-22bf-47af-8684-bfadb17e94fc
---
# Compiler Warning (level 1) C4086

expected pragma parameter to be '1', '2', '4', '8', or '16'
> expected pragma parameter to be '1', '2', '4', '8', or '16'

## Remarks

The pragma parameter does not have the required value (1, 2, 4, 8, or 16).

## Example

The following example generates C4086:

```cpp
// C4086.cpp
// compile with: /W1 /LD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
---
description: "Learn more about: Compiler Warning (level 1) C4087"
title: "Compiler Warning (level 1) C4087"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4087"
ms.date: 11/04/2016
f1_keywords: ["C4087"]
helpviewer_keywords: ["C4087"]
ms.assetid: 546e4d57-5c8e-422c-8ef1-92657336dad5
---
# Compiler Warning (level 1) C4087

'function' : declared with 'void' parameter list
> 'function' : declared with 'void' parameter list

## Remarks

The function declaration has no formal parameters, but the function call has actual parameters. Extra parameters are passed according to the calling convention of the function.

This warning is for the C compiler.

## Example

The following example generates C4087:

```c
// C4087.c
// compile with: /W1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4088"
title: "Compiler Warning (level 1) C4088"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4088"
ms.date: 11/04/2016
f1_keywords: ["C4088"]
helpviewer_keywords: ["C4088"]
ms.assetid: 9bab817c-16b2-4324-be5e-f9cbb06b702e
---
# Compiler Warning (level 1) C4088

'function' : pointer mismatch in actual parameter 'number', formal parameter 'number'
> 'function' : pointer mismatch in actual parameter 'number', formal parameter 'number'

## Remarks

The corresponding formal and actual parameters have a different level of indirection. The actual parameter is passed without change. The called function interprets its value as a pointer.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4089"
title: "Compiler Warning (level 1) C4089"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4089"
ms.date: 11/04/2016
f1_keywords: ["C4089"]
helpviewer_keywords: ["C4089"]
ms.assetid: 7c8f929b-9bf9-4063-9b7e-4affd98c1acc
---
# Compiler Warning (level 1) C4089

'function' : different types in actual parameter 'number', formal parameter 'number'
> 'function' : different types in actual parameter 'number', formal parameter 'number'

## Remarks

The corresponding formal and actual parameters have different types. The actual parameter is passed without change. The function casts the actual parameter to the type specified in the function definition.
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
---
description: "Learn more about: Compiler Warning (level 1) C4090"
title: "Compiler Warning (level 1) C4090"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4090"
ms.date: 11/04/2016
f1_keywords: ["C4090"]
helpviewer_keywords: ["C4090"]
ms.assetid: baad469d-23d4-45aa-ad9c-305b32d61e9a
---
# Compiler Warning (level 1) C4090

'operation' : different 'modifier' qualifiers
> 'operation' : different 'modifier' qualifiers

## Remarks

A variable used in an operation is defined with a specified modifier that prevents it from being modified without detection by the compiler. The expression is compiled without modification.

This warning can be caused when a pointer to a **`const`** or **`volatile`** item is assigned to a pointer not declared as pointing to **`const`** or **`volatile`**.

This warning is issued for C programs. In a C++ program, the compiler issues an error: [C2440](../../error-messages/compiler-errors-1/compiler-error-c2440.md).

The following sample generates C4090:
## Example

The following example generates C4090:

```c
// C4090.c
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1 and level 2) C4091"
title: "Compiler Warning (level 1 and level 2) C4091"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1 and level 2) C4091"
ms.date: 11/04/2016
f1_keywords: ["C4091"]
helpviewer_keywords: ["C4091"]
---
# Compiler Warning (level 1 and level 2) C4091

> '*keyword*': ignored on left of '*type*' when no variable is declared

## Remarks

The compiler detected a situation where the user probably intended a variable to be declared, but the compiler wasn't able to declare the variable.

## Examples

A **`__declspec`** attribute at the beginning of a user-defined type declaration applies to the variable of that type. C4091 indicates no variable is declared. The following sample generates C4091.
A **`__declspec`** attribute at the beginning of a user-defined type declaration applies to the variable of that type. C4091 indicates no variable is declared. The following example generates C4091.

```cpp
// C4091.cpp
Expand All @@ -28,7 +30,7 @@ __declspec(dllimport) class X2 {} varX;
class __declspec(dllimport) X3 {};
```

If an identifier is a typedef, it can't also be a variable name. The following sample generates C4091.
If an identifier is a typedef, it can't also be a variable name. The following example generates C4091.

```cpp
// C4091_b.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) C4096"
title: "Compiler Warning (level 1) C4096"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4096"
ms.date: 11/04/2016
f1_keywords: ["C4096"]
helpviewer_keywords: ["C4096"]
ms.assetid: abf3cca2-2f21-45d8-b025-6b513b00681e
---
# Compiler Warning (level 1) C4096

'a': interface is not a COM interface; will not be emitted to IDL
> 'a': interface is not a COM interface; will not be emitted to IDL

## Remarks

An interface definition that you may have intended as a COM interface was not defined as a COM interface and therefore will not be emitted to the IDL file.

See [Interface Attributes](../../windows/attributes/interface-attributes.md) for a list attributes that indicate an interface is a COM interface.

The following sample generates C4096:
## Example

The following example generates C4096:

```cpp
// C4096.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) C4097"
title: "Compiler Warning (level 1) C4097"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4097"
ms.date: 11/04/2016
f1_keywords: ["C4097"]
helpviewer_keywords: ["C4097"]
ms.assetid: 2525be51-fac2-43b2-b57c-3bbf1a2268f7
---
# Compiler Warning (level 1) C4097

expected pragma parameter to be 'restore' or 'off'
> expected pragma parameter to be 'restore' or 'off'

## Remarks

A pragma was passed an invalid value.

The following sample generates C4097:
## Example

The following example generates C4097:

```cpp
// C4097.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) C4098"
title: "Compiler Warning (level 1) C4098"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4098"
ms.date: 11/04/2016
f1_keywords: ["C4098"]
helpviewer_keywords: ["C4098"]
ms.assetid: 8c8aef1c-1639-44ec-a3dd-c0dfe9aa727d
---
# Compiler Warning (level 1) C4098

'function' : void function returning a value
> 'function' : void function returning a value

## Remarks

A function declared with return type [void](../../cpp/void-cpp.md) has a **`return`** statement that returns a value. The compiler assumes the function returns a value of type **`int`**.
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Warning (level 1) C4103"
title: "Compiler Warning (level 1) C4103"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4103"
ms.date: 11/04/2016
f1_keywords: ["C4103"]
helpviewer_keywords: ["C4103"]
ms.assetid: 9021b514-375e-4d62-b261-ccb06f299e8e
---
# Compiler Warning (level 1) C4103

'filename' : alignment changed after including header, may be due to missing #pragma pack(pop)
> 'filename' : alignment changed after including header, may be due to missing #pragma pack(pop)

## Remarks

Packing affects the layout of classes, and commonly, if packing changes across header files, there can be problems.

Use #pragma [pack](../../preprocessor/pack.md)(pop) before exiting the header file to resolve this warning.

The following sample generates C4103:
## Example

The following example generates C4103:

```cpp
// C4103.h
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
description: "Learn more about: Compiler Warning (level 1) C4109"
title: "Compiler Warning (level 1) C4109"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4109"
ms.date: 11/04/2016
f1_keywords: ["C4109"]
helpviewer_keywords: ["C4109"]
ms.assetid: 9e8d95c6-e05d-47e0-bd87-78974b3cc06c
---
# Compiler Warning (level 1) C4109

unexpected identifier 'identifier'
> unexpected identifier 'identifier'

## Remarks

The pragma containing the unexpected identifier is ignored.

## Example

The following example generates C4109:

```cpp
// C4109.cpp
// compile with: /W1 /LD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4113"
title: "Compiler Warning (level 1) C4113"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4113"
ms.date: 11/04/2016
f1_keywords: ["C4113"]
helpviewer_keywords: ["C4113"]
ms.assetid: ec7a7c4a-d2ee-431c-89dc-31b0f9bfd975
---
# Compiler Warning (level 1) C4113

'identifier1' differs in parameter lists from 'identifier2'
> 'identifier1' differs in parameter lists from 'identifier2'

## Remarks

A function pointer is assigned to another function pointer, but the formal parameter lists of the functions do not agree. The assignment is compiled without modification.
Loading