Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 932 Bytes

compiler-warning-level-1-c4055.md

File metadata and controls

43 lines (34 loc) · 932 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4055
Compiler Warning (level 1) C4055
11/04/2016
C4055
C4055
f9955421-16ab-46e5-8f9d-bf1639a519ef

Compiler Warning (level 1) C4055

'conversion' : from data pointer 'type1' to function pointer 'type2'

Remarks

Obsolete: This warning is not generated by Visual Studio 2017 and later versions.

A data pointer is cast (possibly incorrectly) to a function pointer. This is a level 1 warning under /Za and a level 4 warning under /Ze.

Example

The following sample generates C4055:

// C4055.c
// compile with: /Za /W1 /c
typedef int (*PFUNC)();
int *pi;
PFUNC f() {
   return (PFUNC)pi;   // C4055
}

Under /Ze, this is a level 4 warning.

// C4055b.c
// compile with: /W4 /c
typedef int (*PFUNC)();
int *pi;
PFUNC f() {
return (PFUNC)pi;   // C4055
}