Bug 80823

Summary: broken source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: rsyncAssignee: Jay Fenlason <fenlason>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: jfeeney
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.6.0-0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-06 15:29:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description d.binderman 2002-12-31 18:11:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I have just tried to compile package rsync-2.5.5-1 from Redhat 8.0

Here are some of the messages the compiler produces

cc: Info: token.c, line 200: In this statement, the right shift count "8" is greater than or equal to the size of the unpromoted operand "(char)n". 
(rightshiftovr)

Here is an untested patch to shut up the compiler.

./token.c.old ./token.c
*** ./token.c.old	Wed Dec 25 10:15:44 2002
--- ./token.c	Wed Dec 25 10:16:08 2002
***************
*** 197,203 ****
  			write_byte(f, n >> 8);
  			if (write_batch) { /* dw */
  			    write_batch_delta_file((char *)&n,sizeof(char));
! 			    temp_byte = (char) n >> 8;
  			    write_batch_delta_file(&temp_byte,sizeof(temp_byte));
  			}
  		}
--- 197,203 ----
  			write_byte(f, n >> 8);
  			if (write_batch) { /* dw */
  			    write_batch_delta_file((char *)&n,sizeof(char));
! 			    temp_byte = (char) (n >> 8);
  			    write_batch_delta_file(&temp_byte,sizeof(temp_byte));
  			}
  		}


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


How reproducible:
Always

Steps to Reproduce:
1. compile with any C compiler that sanity checks shift counts, for example Compaq C.
2.
3.
    

Additional info:

Comment 1 Jay Fenlason 2004-01-06 15:29:46 UTC
This fix was included in 2.6.0, which should be avaliable in RawHide 
now.  A further fix that corrects the code on big-endian machines has 
been committed to upstream CVS and should be included in 2.6.1.