Bug 79636 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gnuchess
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-14 10:31 UTC by d.binderman
Modified: 2007-04-18 16:49 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-06-04 10:44:09 UTC
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2002-12-14 10:31:01 UTC
Description of problem:

Hello there,

I just tried to compile package gnuchess-5.02-9 from Redhat 8.0.

Here are some of the compiler messages.

book.c:83: warning: `wfp' might be used uninitialized in this function
eval.c:658: warning: operation on `c' may be undefined
iterate.c:98: warning: too few arguments for format
players.c:180: warning: `result' might be used uninitialized in this function

Here is a patch which shuts up the compiler.

*** ./src/book.c.old	2002-11-26 14:25:15.000000000 +0000
--- ./src/book.c	2002-11-26 14:25:42.000000000 +0000
***************
*** 80,86 ****
   */
  void BookBuilder(short depth, int score, short result, short side)
  {
!   FILE *wfp,*rfp;
    register i;
    int targetslot, found = 0, storeit = 0, tot;
    if (depth == -1 && score == -1) {
--- 80,86 ----
   */
  void BookBuilder(short depth, int score, short result, short side)
  {
!   FILE *wfp = NULL,*rfp;
    register i;
    int targetslot, found = 0, storeit = 0, tot;
    if (depth == -1 && score == -1) {
*** ./src/eval.c.old	2002-11-26 14:27:33.000000000 +0000
--- ./src/eval.c	2002-11-26 14:27:44.000000000 +0000
***************
*** 655,661 ****
     while (c)
     {
        sq = leadz (c);
!       c = CLEARBIT (c, sq);
     }
     return (s);
  }
--- 655,661 ----
     while (c)
     {
        sq = leadz (c);
!       CLEARBIT (c, sq);
     }
     return (s);
  }
*** ./src/iterate.c.old	2002-11-26 14:31:29.000000000 +0000
--- ./src/iterate.c	2002-11-26 14:34:03.000000000 +0000
***************
*** 95,101 ****
        /* To prevent huge surplus build-up. */
        if (TCinc != 0)
          if (SearchTime < TCinc) {
!           printf("TimeLimit[%s] = %6.2f\n",TimeLimit[side]);
            if (TimeLimit[side] > 30) {   /* Only if > 15 seconds left */
              SearchTime = TCinc;
            }
--- 95,101 ----
        /* To prevent huge surplus build-up. */
        if (TCinc != 0)
          if (SearchTime < TCinc) {
!           printf("TimeLimit[%d] = %6.2f\n", side, TimeLimit[side]);
            if (TimeLimit[side] > 30) {   /* Only if > 15 seconds left */
              SearchTime = TCinc;
            }
*** ./src/players.c.old	2002-11-26 14:34:24.000000000 +0000
--- ./src/players.c	2002-11-26 14:34:44.000000000 +0000
***************
*** 177,183 ****
  void DBUpdatePlayer (char *player, char *resultstr)
  {
    char *p, *x;
!   int index,result;
    memset(lname,0,sizeof(lname));
    p = player;
    x = lname;
--- 177,183 ----
  void DBUpdatePlayer (char *player, char *resultstr)
  {
    char *p, *x;
!   int index,result = 0;
    memset(lname,0,sizeof(lname));
    p = player;
    x = lname;


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:

Comment 1 Karsten Hopp 2003-06-04 10:44:09 UTC
I'll leave that kind of fixes for upstream  (bug-gnu-chess) 


Note You need to log in before you can comment on or make changes to this bug.