Bug 79636 - bad source code
bad source code
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: gnuchess (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-14 05:31 EST by d.binderman
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-06-04 06:44:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2002-12-14 05:31:01 EST
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 06:44:09 EDT
I'll leave that kind of fixes for upstream  (bug-gnu-chess@gnu.org) 

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