Bug 152888

Summary: black-box-1.4.7-3: local variable used before set
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Ladislav Michnovic <lmichnovic>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2006-02-22 19:43:19 UTC
I just tried to compile package black-box-1.4.7-3 with the Intel C compiler.

It said

blackbox.c(663): warning #592: variable "crystal_num" is used before its value is set

The source code is

  int x,y,crystal_num;

  for (x=0;x<=10;x++){
    for (y=0;y<=8;y++){
      think[x][y]=0;
      light[x][y]=0;
    }
  }
  while ((crystal_num>difficulty*3)||(crystal_num<(difficulty-1)*3))

Suggest initialise local variable "crystal_num" before first use.
Comment 1 Ladislav Michnovic 2006-02-23 11:06:14 UTC
I'll take a closer look on the soruce code. Thak you for reporting this bug.
Comment 2 Ladislav Michnovic 2006-02-24 16:43:59 UTC
Fixed, patch submited.