RFC: 64bit compilation warning removal

Darren Tucker dtucker at zip.com.au
Thu Nov 10 11:21:33 EST 2005

On Wed, Nov 09, 2005 at 03:44:06PM -0800, Shaw Vrana wrote:
> I forgot to attach any warnings to my previous post.  Unfortunately, the 
> machine I was using has disappeared and the build stops after one 
> warning.  Thus, this is currently the only warning I have, but there are 
> at least a handful more.
>  ../../src/hostfile.c: In function `extract_salt':
> ../../src/hostfile.c:92: warning: unsigned int format, different type 
> arg (arg 2)

Well, that one looks like just a bug in the debug() call since "ret"
is a signed int (trivial patch below).

Those macros make it harder to read, and OpenBSD doesn't have them.

Personally, I'd prefer to see the warnings fixed some other way
if possible (eg use of appropriate format specs and/or casts where
appropriate) and those changes fed back to OpenBSD.

Where necessary, those macros could be used (eg your progressmeter
example, where the 64 bit type is due to the file size in the sftp
protocol being 64 bits on the wire) and carried as a Portable-only
change.  I'd be interested to hear other opinions on this, though.

Index: hostfile.c
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/hostfile.c,v
retrieving revision 1.32
diff -u -p -r1.32 hostfile.c
--- hostfile.c	2 Aug 2005 07:07:08 -0000	1.32
+++ hostfile.c	10 Nov 2005 00:15:07 -0000
@@ -88,8 +88,8 @@ extract_salt(const char *s, u_int l, cha
 		return (-1);
 	if (ret != SHA_DIGEST_LENGTH) {
-		debug2("extract_salt: expected salt len %u, got %u",
-		    salt_len, ret);
+		debug2("extract_salt: expected salt len %d, got %d",
+		    SHA_DIGEST_LENGTH, ret);
 		return (-1);

Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

More information about the openssh-unix-dev mailing list