block-backend: Silence clang -m32 compiler warning
PATCH 1/1 block-backend: Silence clang -m32 compiler warning
Similarly to e7e588d432d31ecebc26358e47201dd108db964c, there is a warning in block/block-backend.c that qiov->size <= INT64_MAX is always true on machines where size_t is narrower than a uint64_t. In said commit, we silenced this warning by casting to uint64_t.
The commit introducing this warning here (a93d81c84afa717b0a1a6947524d8d1fbfd6bbf5) anticipated it and so tried to address it the same way. However, it only did so in one of two places where this comparison occurs, and so we still need to fix up the other one.
("block-backend: convert blk_aio_ functions to int64_t bytes paramter")
--- block/block-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/block-backend.c +1 -1
@@ -1540,7 +1540,7 @@ BlockAIOCB *blk_aio_pwritev(BlockBackend *blk, int64_t offset, QEMUIOVector *qiov, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque) { - assert(qiov->size <= INT64_MAX); + assert((uint64_t)qiov->size <= INT64_MAX); return blk_aio_prwv(blk, offset, qiov->size, qiov,blk_aio_write_entry ,flags ,cb ,opaque ); }
Signature · 1 line
2.31.1
Quoted 11 lines · Hanna Reitz
Similarly to
e7e588d432d31ecebc26358e47201dd108db964c, there is a warning inblock/block-backend.cthatqiov->size<=INT64_MAXis always true on machines wheresize_tis narrower than auint64_t. In said commit, we silenced this warning by casting touint64_t.The commit introducing this warning here (
a93d81c84afa717b0a1a6947524d8d1fbfd6bbf5) anticipated it and so tried to address it the same way. However, it only did so in one of two places where this comparison occurs, and so we still need to fix up the other one.
Quoted 7 lines
Fixes a93d81c84afa717b0a1a6947524d8d1fbfd6bbf5("block-backend: convert
blk_aio_functions toint64_tbytes paramter")Signed-off-by Hanna Reitz <[email protected]>--- block/block-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Kevin Wolf
AppliedAm 26.10.2021 um 11:07 hat Hanna Reitz geschrieben:
Quoted 11 lines
Similarly to
e7e588d432d31ecebc26358e47201dd108db964c, there is a warning inblock/block-backend.cthatqiov->size<=INT64_MAXis always true on machines wheresize_tis narrower than auint64_t. In said commit, we silenced this warning by casting touint64_t.The commit introducing this warning here (
a93d81c84afa717b0a1a6947524d8d1fbfd6bbf5) anticipated it and so tried to address it the same way. However, it only did so in one of two places where this comparison occurs, and so we still need to fix up the other one.
Quoted 4 lines
Fixes a93d81c84afa717b0a1a6947524d8d1fbfd6bbf5("block-backend: convert
blk_aio_functions toint64_tbytes paramter")Signed-off-by Hanna Reitz <[email protected]>
Thanks, applied to the block branch.
Kevin