From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmMcF-0004xp-CH for qemu-devel@nongnu.org; Mon, 28 Aug 2017 12:10:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmMcC-0000Jg-42 for qemu-devel@nongnu.org; Mon, 28 Aug 2017 12:10:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40658) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmMcB-0000GB-Ty for qemu-devel@nongnu.org; Mon, 28 Aug 2017 12:10:16 -0400 References: <20170823083901.852-1-quintela@redhat.com> <20170823083901.852-2-quintela@redhat.com> From: Thomas Huth Message-ID: <6f537126-f1a6-2159-d8f7-35d34b803dfa@redhat.com> Date: Mon, 28 Aug 2017 18:10:09 +0200 MIME-Version: 1.0 In-Reply-To: <20170823083901.852-2-quintela@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] tests: Use real size for iov tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org Cc: lvivier@redhat.com, pbonzini@redhat.com, dgilbert@redhat.com, peterx@redhat.com, Christian Borntraeger , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= On 23.08.2017 10:39, Juan Quintela wrote: > We were using -1 instead of the real size because the functions check > what is bigger, size in bytes or the size of the iov. Recent gcc's > barf at this. >=20 > Signed-off-by: Juan Quintela > --- > tests/test-iov.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) While you're at it, could you maybe also adjust the comments in include/qemu/iov.h ? It currently says: * It is okay to use very large value for `bytes' since we're * limited by the size of the iovec anyway, provided that the * buffer pointed to by buf has enough space. One possible * such "large" value is -1 (sinice size_t is unsigned), * so specifying `-1' as `bytes' means 'up to the end of iovec'. ... and apparently -1 is not working anymore as expected. Maybe SIZE_MAX from stdint.h is a better choice? Thomas