Bug 79638

Summary: bad source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: hdparmAssignee: Karsten Hopp <karsten>
Status: CLOSED RAWHIDE QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: srevivo
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:52:19 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:

Description d.binderman 2002-12-14 10:36:35 UTC
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 10:52:19 UTC
seems to be fixed in hdparm-5.4