]> asedeno.scripts.mit.edu Git - PuTTY.git/commit - unix/uxsftp.c
Shifts left and right by 32 were tripping a gcc warning (fatal with
authorSimon Tatham <anakin@pobox.com>
Tue, 15 Aug 2006 20:29:02 +0000 (20:29 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 15 Aug 2006 20:29:02 +0000 (20:29 +0000)
commit92e75acbb5bd1f500b2d4cb3ddb8d341a5834b42
treeb4976a9e9803ad323fa3dc1cabe18888097195a5
parent09f86ce7ec4f57794993c9299e1e4de62e17e075
Shifts left and right by 32 were tripping a gcc warning (fatal with
-Werror, of course) about shifting by more than the range of a data
type. They only appeared in `if' statements testing sizeof(off_t),
but gcc warns even when the code is unreachable. I've removed the
conditional code (the general case should still work even on 32-bit
machines), and hacked each shift by 32 into a pair of shifts by 16.

Note that the gcc warning is not just a helpful indication that you
may be using the wrong data type; it's actually pointing out ANSI-
undefined behaviour in shifting a signed integer beyond the size of
its type.

[originally from svn r6789]
unix/uxsftp.c