Pasted below is a small piece of code I am having trouble with when I use -ansi to compile it. This works fine with mingw32. Would appreciate any suggestions on how to fix this. I am using gcc-4.5.0
test.c: In function 'main':
test.c:6:2: warning: unknown conversion type character 'l' in format
test.c:6:2: warning: too many arguments for format
</pre>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Pasted below is a small piece of code I am having trouble with when I use -ansi to compile it. This works fine with mingw32. Would appreciate any suggestions on how to fix this. I am using gcc-4.5.0
<pre>
$ cat test.c
#include <stdio.h>
#include <stdint.h>
int main() {
uint64_t foo = 5;
fprintf(stderr, "VC: foo=%llu\n", foo);
return 0;
}
Command line used:
gcc -ansi -pedantic -Wall test.c
Warnings:
test.c: In function 'main':
test.c:6:2: warning: unknown conversion type character 'l' in format
test.c:6:2: warning: too many arguments for format
</pre>
I don't there are 64bit types for ANSI, so %llu might make little sense.
In any case, you should be using %I64u if using msvcrt printf family.