Export (0) Print
Expand All
Expand Minimize
0 out of 3 rated this helpful - Rate this topic

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.

Example

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
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.