Bug 79636
| Summary: | bad source code | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | d.binderman |
| Component: | gnuchess | Assignee: | Karsten Hopp <karsten> |
| Status: | CLOSED UPSTREAM | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.0 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2003-06-04 10:44:09 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
I'll leave that kind of fixes for upstream (bug-gnu-chess) |
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: