* [PATCH blktests] fix discontiguous-io compile error on 32 bit systems
@ 2018-11-01 6:35 Yufen Yu
2018-11-01 14:52 ` Bart Van Assche
0 siblings, 1 reply; 4+ messages in thread
From: Yufen Yu @ 2018-11-01 6:35 UTC (permalink / raw)
To: osandov; +Cc: linux-block, bart.vanassche
When make discontiguous-io.cpp with -m32, g++ compiler reports
error for std::min(long unsigned int, size_t) has diffent
arguments type.
fixes: fd21728886e7 ("Add the discontiguous-io test program")
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
src/discontiguous-io.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/discontiguous-io.cpp b/src/discontiguous-io.cpp
index 5e0ee0f..855aba9 100644
--- a/src/discontiguous-io.cpp
+++ b/src/discontiguous-io.cpp
@@ -291,7 +291,7 @@ int main(int argc, char **argv)
unsigned char *p = &*buf.begin();
for (int i = 0; i < len / 4; i++)
iov.append(p + 4 + i * 8,
- std::min(4ul, len - i * 4));
+ std::min((size_t)4, len - i * 4));
} else {
iov.append(&*buf.begin(), buf.size());
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH blktests] fix discontiguous-io compile error on 32 bit systems
2018-11-01 6:35 [PATCH blktests] fix discontiguous-io compile error on 32 bit systems Yufen Yu
@ 2018-11-01 14:52 ` Bart Van Assche
2018-11-06 2:19 ` yuyufen
0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2018-11-01 14:52 UTC (permalink / raw)
To: Yufen Yu, osandov; +Cc: linux-block, bart.vanassche, Theodore Ts'o
On Thu, 2018-11-01 at 14:35 +0800, Yufen Yu wrote:
> When make discontiguous-io.cpp with -m32, g++ compiler reports
> error for std::min(long unsigned int, size_t) has diffent
> arguments type.
>
> fixes: fd21728886e7 ("Add the discontiguous-io test program")
> Signed-off-by: Yufen Yu <yuyufen@huawei.com>
> ---
> src/discontiguous-io.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/discontiguous-io.cpp b/src/discontiguous-io.cpp
> index 5e0ee0f..855aba9 100644
> --- a/src/discontiguous-io.cpp
> +++ b/src/discontiguous-io.cpp
> @@ -291,7 +291,7 @@ int main(int argc, char **argv)
> unsigned char *p = &*buf.begin();
> for (int i = 0; i < len / 4; i++)
> iov.append(p + 4 + i * 8,
> - std::min(4ul, len - i * 4));
> + std::min((size_t)4, len - i * 4));
> } else {
> iov.append(&*buf.begin(), buf.size());
> }
Are you reading the messages posted on linux-block? An alternative that I like
better has been discussed in this e-mail thread:
https://www.spinics.net/lists/linux-block/msg32181.html
Bart.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH blktests] fix discontiguous-io compile error on 32 bit systems
2018-11-01 14:52 ` Bart Van Assche
@ 2018-11-06 2:19 ` yuyufen
2018-11-06 3:29 ` Bart Van Assche
0 siblings, 1 reply; 4+ messages in thread
From: yuyufen @ 2018-11-06 2:19 UTC (permalink / raw)
To: Bart Van Assche, osandov; +Cc: linux-block, bart.vanassche, Theodore Ts'o
On 2018/11/1 22:52, Bart Van Assche wrote:
> On Thu, 2018-11-01 at 14:35 +0800, Yufen Yu wrote:
>> When make discontiguous-io.cpp with -m32, g++ compiler reports
>> error for std::min(long unsigned int, size_t) has diffent
>> arguments type.
>>
>> fixes: fd21728886e7 ("Add the discontiguous-io test program")
>> Signed-off-by: Yufen Yu <yuyufen@huawei.com>
>> ---
>> src/discontiguous-io.cpp | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/discontiguous-io.cpp b/src/discontiguous-io.cpp
>> index 5e0ee0f..855aba9 100644
>> --- a/src/discontiguous-io.cpp
>> +++ b/src/discontiguous-io.cpp
>> @@ -291,7 +291,7 @@ int main(int argc, char **argv)
>> unsigned char *p = &*buf.begin();
>> for (int i = 0; i < len / 4; i++)
>> iov.append(p + 4 + i * 8,
>> - std::min(4ul, len - i * 4));
>> + std::min((size_t)4, len - i * 4));
>> } else {
>> iov.append(&*buf.begin(), buf.size());
>> }
> Are you reading the messages posted on linux-block? An alternative that I like
> better has been discussed in this e-mail thread:
> https://www.spinics.net/lists/linux-block/msg32181.html
>
> Bart.
>
> .
>
I am sorry that I did not see the discussion before this.
And you are right. Please ignore this patch.
Yufen.
thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH blktests] fix discontiguous-io compile error on 32 bit systems
2018-11-06 2:19 ` yuyufen
@ 2018-11-06 3:29 ` Bart Van Assche
0 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2018-11-06 3:29 UTC (permalink / raw)
To: yuyufen, osandov; +Cc: linux-block, bart.vanassche, Theodore Ts'o
On 11/5/18 6:19 PM, yuyufen wrote:
> I am sorry that I did not see the discussion before this.
> And you are right. Please ignore this patch.
Don't worry - this can happen :-)
Bart.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-06 12:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 6:35 [PATCH blktests] fix discontiguous-io compile error on 32 bit systems Yufen Yu
2018-11-01 14:52 ` Bart Van Assche
2018-11-06 2:19 ` yuyufen
2018-11-06 3:29 ` Bart Van Assche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.