[PATCH] warning: comparison between signed and unsigned in function source at scp.c

Carlo Marcelo Arenas Belon carenas at sajinet.com.pe
Sun Apr 16 14:59:57 EST 2006


Greetings,

Attached patch "fixes" the following warning while compiling with gcc 3.4.5,
openssh 4.3p2 in an AMD64 Linux system, which is triggered by the comparison
between off_t (signed long) and size_t (unsigned long) as shown :

scp.c: In function `source':
scp.c:632: warning: comparison between signed and unsigned
scp.c:639: warning: comparison between signed and unsigned

I am afraid though, that removing this warning is mostly aesthetic as automatic
conversions between signed and unsigned long are still being done while
calling atomicio or any other of the arithmetic comparisons.

Carlo
-------------- next part --------------
Index: scp.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/scp.c,v
retrieving revision 1.141
diff -u -r1.141 scp.c
--- scp.c	1 Apr 2006 05:50:29 -0000	1.141
+++ scp.c	16 Apr 2006 04:31:34 -0000
@@ -548,8 +548,7 @@
 	struct stat stb;
 	static BUF buffer;
 	BUF *bp;
-	off_t i, amt, statbytes;
-	size_t result;
+	off_t i, amt, statbytes, result;
 	int fd = -1, haderr, indx;
 	char *last, *name, buf[2048];
 	int len;


More information about the openssh-unix-dev mailing list