Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 78461 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: units
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-23 12:21 UTC by d.binderman
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-11-23 12:21:53 UTC


Attachments (Terms of Use)

Description d.binderman 2002-11-23 12:21:46 UTC
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 10:36:48 UTC
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.