| December 7, 2009 12:00 AM PST | |
Casue:
This warning is triggered by a printf or scanf format specifier that is not appropriate for the type of the variable being printed.
This warning is triggered by a printf or scanf format specifier that is not appropriate for the type of the variable being printed.
Example:
#include <stdio.h>
int main() {
long int li = 0;
printf("%l\n",li); // %l is the size specifier; the type specifer is missing
printf("%ld\n",li); // OK
return 0;
}
> icl -c /W4 diag269.cpp
Intel(R) C++ Compiler Professional for applications running on IA-32, Version 11.1 Build 20090511 Package ID: w_cproc_p_11.1.035
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.diag269.cpp
diag269.cpp(5): warning #269: invalid format string conversion
printf("%l\n",li);
^
Resolution :
Use proper type specifier.
Do you need more help?
This article applies to: Intel® C++ Compiler for Linux* Knowledge Base, Intel® C++ Compiler for Mac OS X* Knowledge Base, Intel® C++ Compiler for Windows* Knowledge Base, Intel® Parallel Composer Knowledge Base
For more complete information about compiler optimizations, see our Optimization Notice.
Comments (5) 
| May 27, 2009 9:21 AM PDT
Jennifer Jiang (Intel)
| which version of the Intel C++ compiler are you using and which VC? I do not get this warning with 10.1 or 11.x. |
| May 27, 2009 9:31 AM PDT
Jennifer Jiang (Intel)
| btw. please post such questions to our C++ forum - http://software.intel.com/en-us/forums/intel-c-compiler |
| May 28, 2009 1:21 AM PDT
Naveen T | Intel(R) C++ Compiler for Intel(R) EM64T-based applications, Version 8.1 Build 20051118 Package ID: W_CCE_PC_8.1.025 |
| May 28, 2009 8:25 AM PDT
Jennifer Jiang (Intel)
| 8.1 version is very old. please upgrade to 11.0. This issue is fixed in the 10.1 and newer release. Or you can try the Parallel Composer. |
Trackbacks (0)
Leave a comment 
To obtain technical support, please go to Software Support.
Author
Jennifer Jiang (Intel)
| ||
Mark Sabahi (Intel)
|


Naveen T
main()
{
size_t a;
printf("Enter the value of a:");
scanf("%Iu",&a);
printf("%#Ix",a);
}
Gives me this warning messages...
size.c(6): warning #269: invalid format string conversion
scanf("%Iu",&a);
^
size.c(7): warning #269: invalid format string conversion
printf("%#Ix",a);
^
output is fine but i want to get rid of this warning message...Is there a way?
I used the above format specifiers based on this url--
http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx