Bug 80823 - broken source code
Summary: broken source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rsync
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-31 18:11 UTC by d.binderman
Modified: 2014-08-31 23:24 UTC (History)
1 user (show)

Fixed In Version: 2.6.0-0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-01-06 15:29:46 UTC


Attachments (Terms of Use)

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. 


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