Bug 132484

Summary: lkcdutils-4.2-207: 2 * local variable used before set
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: KernelAssignee: Hannes Reinecke <hare>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: varap
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2005-11-05 23:14:38 UTC
Hello there,

I just tried to compile package lkcdutils-4.2-207 with the Intel C compiler.

It said

1.

cmd_whatis.c(217): warning #592: variable "flags" is used before its value is set

The source code is

                                kl_print_type((void *)NULL, kltp, 0,
                                        flags|SUPPRESS_NAME, cmd->ofp);

I have had a look at the code, and I agree with the compiler. 
Suggest initialise local variable "flags" before first use. 

2.

cmd_deftask.c(42): warning #592: variable "task" is used before its value is set

The source code is

	if (KL_ERROR || (task && (mode != 2))) {

I have had a look at the code, and I agree with the compiler. 
Suggest initialise local variable "task" before first use. 

BTW, the email address of the author, as best as I could figure out
[ lucc@sgi.com ] seems to be dead.
Comment 1 Olaf Kirch 2005-11-15 11:45:29 UTC
Nice, thanks for the feedback.

Re issue 1:
	the local variable "flags" seems to be a relic. Looks like
	it should go, and the two remaining uses of it should read
	cmd->flags instead.

Re issue 2:
	this should fix it:

-	if (KL_ERROR || (task && (mode != 2))) {
+	if (KL_ERROR || (value && (mode != 2))) {
Comment 3 Hannes Reinecke 2006-03-09 12:13:02 UTC
Fixed with Beta6.