Bugzilla – Bug 137978
ckermit-8.0.211-6: printf problems
Last modified: 2006-01-23 16:24:03 UTC
I just tried to compile package ckermit-8.0.211-6 with the Intel C compiler. It said ckuus7.c(2987): warning #267: the format string requires additional arguments The source code is printf(" Matches = %d: Not enough to purge.\n"); %d specifier, but no trailing parameter. Suggest add one. I tried emailing the author [ fdc@columbia.edu ] but got no reply.
strange that gcc doesn't catch this (neither does with -O0)
For GCC to detect this you must use -Wformat or -Wall (which includes the former), and must have printf() declared in the correct way, like e.g. glibc does it (with format attributes), so the correct headers must also be included. If all of this is the case, then we need a preprocessed file where GCC fails to detect the incorrect format.
(In reply to comment #1) > strange that gcc doesn't catch this (neither does with -O0) Suggest use -Wall with gcc everytime. In general, using gcc without -Wall is risky with lots of downside and very little upside. You may then choose, after careful consideration, to ignore *some* of the warnings that gcc -Wall produces.
The printf was redefined without the format attribute (which, as Michael explained , is neccessary to catch such errors in gcc) -> fixed.