Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Nov 2008 21:48:33 -0800
From:      Xin LI <delphij@delphij.net>
To:        Tim Kientzle <kientzle@FreeBSD.ORG>
Cc:        svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG
Subject:   Re: svn commit: r184668 - head/usr.bin/tar/test
Message-ID:  <491133B1.9050208@delphij.net>
In-Reply-To: <200811050526.mA55QBk4017410@svn.freebsd.org>
References:  <200811050526.mA55QBk4017410@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Kientzle wrote:
> Author: kientzle
> Date: Wed Nov  5 05:26:11 2008
> New Revision: 184668
> URL: http://svn.freebsd.org/changeset/base/184668
> 
> Log:
>   Fix compile warnings building on amd64.  This is modified slightly
>   from Jaakko's original patch: I have misgivings about the portability
>   of the 'z' printf modifier so opted to cast the arguments to (int)
>   instead.
>   
>   PR:		bin/128561
>   Submitted by:	Jaakko Heinonen
>   MFC after:	30 days
> 
[...]
> @@ -494,7 +494,8 @@ test_assert_empty_file(const char *f1fmt
>  	if (fd < 0) {
>  		fprintf(stderr, "    Unable to open %s\n", f1);
>  	} else {
> -		s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size;
> +		s = (sizeof(buff) < (size_t)st.st_size) ?
> +		    (ssize_t)sizeof(buff) : (ssize_t)st.st_size;

I'm more or less concerned about this - st_size is off_t, is it safe to
cast it to size_t when comparing here?

>  		s = read(fd, buff, s);
>  		hexdump(buff, NULL, s, 0);
>  	}
> 


- --
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkkRM7AACgkQi+vbBBjt66D/YwCgqm9Do0SwckV4Da86gEyU4Yk8
AXMAni2tF+SzEObjliVy1z03irw7Qd6g
=M8sh
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?491133B1.9050208>