[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] tests: Use real size for iov tests
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] tests: Use real size for iov tests |
Date: |
Mon, 28 Aug 2017 18:10:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
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.
>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> 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
[Qemu-devel] [PATCH 1/2] tests: Use real size for iov tests, Juan Quintela, 2017/08/23