Bug 137978 - ckermit-8.0.211-6: printf problems
Summary: ckermit-8.0.211-6: printf problems
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SUSE Other
: P5 - None : Minor
Target Milestone: ---
Assignee: Michael Matz
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-11 14:39 UTC by David Binderman
Modified: 2006-01-23 16:24 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.