summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmmar Faizi <ammarfaizi2@gmail.com>2021-09-16 11:27:31 +0700
committerJens Axboe <axboe@kernel.dk>2021-09-16 09:17:29 -0600
commit64bcc40862b20d25efde357422e2dc76c9985c77 (patch)
treee0d802064aaf215b0c4d1e9e92a19b8b6ecc759a
parent0e81b83dbac6da6715186210c7e65315456e2d6e (diff)
downloadliburing-64bcc40862b20d25efde357422e2dc76c9985c77.tar.gz
liburing-64bcc40862b20d25efde357422e2dc76c9985c77.tar.bz2
test/file-verify: fix 32-bit build -Werror=shift-count-overflow
`off_t` may not always be 64-bit in size. ``` file-verify.c: In function 'test': file-verify.c:193:26: error: left shift count >= width of type [-Werror=shift-count-overflow] sqe->user_data = (off << 32) | i; ^ cc1: all warnings being treated as errors Makefile:164: recipe for target 'file-verify' failed make[1]: *** [file-verify] Error 1 make[1]: Leaving directory '/root/liburing/test' Makefile:12: recipe for target 'all' failed make: *** [all] Error 2 ``` Fix this by using (uint64_t) cast. Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/file-verify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/file-verify.c b/test/file-verify.c
index f5749a6..0a0b5e9 100644
--- a/test/file-verify.c
+++ b/test/file-verify.c
@@ -329,7 +329,7 @@ static int test(struct io_uring *ring, const char *fname, int buffered,
else
io_uring_prep_read(sqe, fd, buf[i], this, off);
}
- sqe->user_data = (off << 32) | i;
+ sqe->user_data = ((uint64_t)off << 32) | i;
off += this;
left -= this;
pending++;