I download rsync.2.5.6, configure, make clean, but make gives this warning:
"io.c", line 653: warning: shift count negative or too big: >>
32
"io.c", line 653: warning: shift count negative or too big: >>
32
"io.c", line 653: warning: shift count negative or too big: >>
32
"io.c", line 653: warning: shift count negative or too big: >>
32
Another 32 bit shift (<<32) at line 385 does not cause a warning because
of this test at line 379:
#ifdef NO_INT64
I verified that NO_INT64 is defined on my system in rsync.h
However there is no #ifdef NO_INT64 test protecting line 653.
Here are lines 652,653, and 654 from io.c in subr write_longint:
SIVAL(b,0,(x&0xFFFFFFFF));
SIVAL(b,4,((x>>32)&0xFFFFFFFF));
writefd(f,b,8);
On my system, x>>32 evaluates to the value x, not 0 (since the
shift count is invalid). This will cause the upper 4 bytes of b to be
the same as the lower 4 bytes of b, even if x is a small value.
I am considering using this hack for line 653 to prevent possible problems:
SIVAL(b,4,((0)&0xFFFFFFFF));
I really don't do much C programming so I am fumbling in the dark
here. Maybe my hack would make things worse. I have not seen any
problems yet (rsync can copy test files that cmp verifies later). make
only shows one other warning or error:
"popt/popt.c", line 910: warning: macro redefined: _ABS
Any advice would be much appreciated.
=== from Steve "Mor" Moritsugu (mori@dtrbus.com)
=== DTR Business Systems Inc (www.dtrbus.com)
On Thu, Mar 20, 2003 at 09:37:23PM -0800, Steve Mor Moritsugu wrote:> I download rsync.2.5.6, configure, make clean, but make gives this warning: > > "io.c", line 653: warning: shift count negative or too big: >> 32 > "io.c", line 653: warning: shift count negative or too big: >> 32 > "io.c", line 653: warning: shift count negative or too big: >> 32 > "io.c", line 653: warning: shift count negative or too big: >> 32 > > Another 32 bit shift (<<32) at line 385 does not cause a warning because > of this test at line 379: > #ifdef NO_INT64 > I verified that NO_INT64 is defined on my system in rsync.h > > However there is no #ifdef NO_INT64 test protecting line 653. > Here are lines 652,653, and 654 from io.c in subr write_longint: > > SIVAL(b,0,(x&0xFFFFFFFF)); > SIVAL(b,4,((x>>32)&0xFFFFFFFF)); > writefd(f,b,8); > > On my system, x>>32 evaluates to the value x, not 0 (since the > shift count is invalid). This will cause the upper 4 bytes of b to be > the same as the lower 4 bytes of b, even if x is a small value. > I am considering using this hack for line 653 to prevent possible problems: > > SIVAL(b,4,((0)&0xFFFFFFFF)); > > I really don't do much C programming so I am fumbling in the dark > here. Maybe my hack would make things worse. I have not seen any > problems yet (rsync can copy test files that cmp verifies later). make > only shows one other warning or error: > "popt/popt.c", line 910: warning: macro redefined: _ABSNice catch. What platform doesn't support 64bit ints? I've attached a patch. I can't really test it but give it a try and let us know. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt -------------- next part -------------- Index: io.c ==================================================================RCS file: /data/cvs/rsync/io.c,v retrieving revision 1.105 diff -u -b -r1.105 io.c --- io.c 11 Apr 2002 02:11:50 -0000 1.105 +++ io.c 21 Mar 2003 07:00:54 -0000 @@ -648,11 +648,16 @@ return; } +#ifdef NO_INT64 + rprintf(FERROR,"Integer overflow - attempted 64 bit offset\n"); + exit_cleanup(RERR_UNSUPPORTED); +#else write_int(f, (int32)0xFFFFFFFF); SIVAL(b,0,(x&0xFFFFFFFF)); SIVAL(b,4,((x>>32)&0xFFFFFFFF)); writefd(f,b,8); +#endif } void write_buf(int f,char *buf,size_t len)
On Mon, Mar 24, 2003 at 06:47:33PM -0800, Steve Mor Moritsugu wrote:> >I've attached a patch. I can't really test it but give >it a > >try and let us know. > > Yes the patch worked fine. make is now clean. no errrors in io.c. The new binary rsync still works well. > > Thank you very much for your prompt response!!! > > PS I hope this is the right way to reply to you. I read your response to me at > http://www.mail-archive.com/rsync@lists.samba.org/msg06896.html > > and at the bottom of the page was a button allowing me to reply to you. (Or should I have replied to rsync@lists.samba.org ?) >Patch comitted. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt