Bug 78461 - bad source code
bad source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: units (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-23 07:21 EST by d.binderman
Modified: 2007-04-18 12:48 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-11-23 07:21:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2002-11-23 07:21:46 EST
Description of Problem:

Hello there,

I just tried to compile package units-1.74-4 from Redhat 8.0.

Here are some of the compiler messages.

units.c:1199: warning: suggest parentheses around comparison in operand of &
units.c:1514: warning: `sep' might be used uninitialized in this function
units.c:1514: warning: `right' might be used uninitialized in this function
units.c:1514: warning: `left' might be used uninitialized in this function

Here is a bunch of patches which fix the messages.

*** ./units.c.old	2002-11-05 13:47:48.000000000 +0000
--- ./units.c	2002-11-05 13:50:39.000000000 +0000
***************
*** 1196,1202 ****
     initializeunit(&outunit);
     if (err=completereduce(inunit))
       return err;
!    if ((n & 1==0) && (inunit->factor<0)) return E_NOTROOT;
     outunit.factor = pow(inunit->factor,1.0/(double)n);
     if (err = subunitroot(n, inunit->numerator, outunit.numerator))
       return err;
--- 1196,1202 ----
     initializeunit(&outunit);
     if (err=completereduce(inunit))
       return err;
!    if (((n & 1) == 0) && (inunit->factor<0)) return E_NOTROOT;
     outunit.factor = pow(inunit->factor,1.0/(double)n);
     if (err = subunitroot(n, inunit->numerator, outunit.numerator))
       return err;
***************
*** 1511,1517 ****
  {
     struct unittype invhave;
     int doingrec;  /* reciprocal conversion? */
!    char *sep, *right, *left;
  
     doingrec=0;
     havestr = removepadding(havestr);
--- 1511,1517 ----
  {
     struct unittype invhave;
     int doingrec;  /* reciprocal conversion? */
!    char *sep = 0, *right = 0, *left = 0;
  
     doingrec=0;
     havestr = removepadding(havestr);


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


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:
Comment 1 Harald Hoyer 2002-11-25 05:36:48 EST
already fixed in units-1.80 though not critical
thx anyway

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