printf has emits a warning on the following code which prevents to build some software that enable warnings as errors such as GDB 6.8.
here is one example:
main(int argc, char **argv)
long long int tick = 1;
printf("sizoef(tick): %d\n", sizeof(tick));
tick <<= 62;
printf("Big number: %lld\n", tick);
printf("Big number: %I64d\n", tick);
this code builds without warnings and errors with GCC 4.2.1. and 3.4.5 with:
gcc -Wall -ansi test.c
With 4.3.0 it emits:
test.c: In function 'main':
test.c:10: warning: format '%I64d' expects type 'int', but argument 2 has type 'long long int'
And GDB fails to build.
Since this is not a GDB bug I think that warning should not be emitted from GCC 4.3.0 as before.
Log in to post a comment.