Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 999 Bytes
title ms.date f1_keywords helpviewer_keywords ms.assetid
Compiler Warning (level 1) C4313
11/04/2016
C4313
C4313
bcf64191-e2cf-452e-97b4-423fcec2d07c

Compiler Warning (level 1) C4313

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

There is a conflict between the format specified and the value that you are passing. For example, you passed a 64-bit parameter to an unqualified %d format specifier, which expects a 32-bit integer parameter. This warning is only in effect when the code is compiled for 64-bit targets.

Example

The following code sample generates C4313 when it is compiled for a 64-bit target.

// C4313.cpp
// Compile by using: cl /W1 C4313.cpp
#include <stdio.h>
int main() {
   int * pI = 0;
   printf("%d", pI);   // C4313 on 64-bit platform code
   // Try one of the following lines instead:
   // printf("%p\n", pI);
   // printf("%Id\n", pI);   // %I64d expects 64-bits of information
}
You can’t perform that action at this time.