Compiler Warning (level 1) C4313

'function' : 'format specifier' in format string conflicts with argument %d of type 'type'

There is a conflict between the format specified and the value that you are passing. For example, you passed a 32-bit pointer to %d format specifier, which can hold a 64-bit integer. This warning is only in effect with /Wp64.


The following code sample generates C4313.

// C4313.cpp
// compile with: /W1 /Wp64
#include <stdio.h>
int main() {
   int * pI = 0;
   printf("%d", pI);   // C4313
   // try one of the following lines instead
   // printf("%p\n", pI);
   // printf("%Id\n", pI);   // %I64d expects 64-bits of information