Compiler Warning (level 1) C4055
TOC
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

Compiler Warning (level 1) C4055

Error Message

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

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.

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
}
Show:
© 2016 Microsoft