Bug 79638 - bad source code
bad source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: hdparm (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-14 05:36 EST by d.binderman
Modified: 2015-01-07 19:02 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-06-04 06:52:19 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:36:35 EST
Description of problem:

Hello there,

I just tried to compile package hdparm-5.2-1 from Redhat 8.0.

Here are some of the compiler messages.

hdparm.c: In function `identify_from_stdin':
hdparm.c:1486: warning: operation on `b' may be undefined
hdparm.c:1486: warning: operation on `b' may be undefined
hdparm.c:1486: warning: operation on `b' may be undefined

Here is an untested patch which shuts up the compiler.

*** ./hdparm.c.old	2002-11-27 09:55:30.000000000 +0000
--- ./hdparm.c	2002-11-27 09:56:52.000000000 +0000
***************
*** 1483,1490 ****
  		exit(errno);
  	}
  	for (i = 0; count >= 4; ++i) {
! 		*w++ = (fromhex(*b++)<<12) | (fromhex(*b++)<<8) | (fromhex(*b++)<<4) | (fromhex(*b++));
! 		++b;
  		count -= 5;
  	}
  	identify((void *)buf, NULL);
--- 1483,1493 ----
  		exit(errno);
  	}
  	for (i = 0; count >= 4; ++i) {
! 		*w++ = (fromhex( b[ 0]) << 12) 
! 			| (fromhex( b[ 1]) << 8) 
! 			| (fromhex( b[ 2]) << 4) 
! 			| (fromhex( b[ 3]));
! 		b += 5;
  		count -= 5;
  	}
  	identify((void *)buf, NULL);


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:52:19 EDT
seems to be fixed in hdparm-5.4 

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