Compiler Warning (level 1) C4313
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Warning (level 1) C4313

Error Message

'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
© 2015 Microsoft