Bug 137978

Summary: ckermit-8.0.211-6: printf problems
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Michael Matz <matz>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2005-12-11 14:39:52 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.
Comment 1 Marian Jancar 2006-01-20 15:47:16 UTC
strange that gcc doesn't catch this (neither does with -O0)
Comment 2 Michael Matz 2006-01-20 17:04:13 UTC
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.
Comment 3 David Binderman 2006-01-21 10:17:45 UTC
(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.


Comment 4 Marian Jancar 2006-01-23 16:24:03 UTC
The printf was redefined without the format attribute (which, as Michael explained , is neccessary to catch such errors in gcc) -> fixed.