Skip to contentSkip to conversation

Update .gitignore and fix 32-bit build

PATCH Applied Ammar Faizi 2 participants 5 messages Sep 16, 2021 io_uring

lore
Share & tools
lore
#0 lore raw

cover Update .gitignore and fix 32-bit build

- Add test/file-verify to .gitignore.
- Fix 32-bit build

----------------------------------------------------------------
Ammar Faizi (2):
.gitignore: add test/file-verify
test/file-verify: fix 32-bit build -Werror=shift-count-overflow

 .gitignore         | 1 +
 test/file-verify.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
#1 lore raw

PATCH 1/2 .gitignore: add `test/file-verify`

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index 45f3cde..bd0623a 100644
@@ -54,6 +54,7 @@
 /test/fc2a85cb02ef-test
 /test/file-register
 /test/file-update
+test/file-verify
 /test/files-exit-hang-poll
 /test/files-exit-hang-timeout
 /test/fixed-link
Signature · 1 line
2.30.2
#2 lore raw

PATCH v2 1/2 .gitignore: add `test/file-verify`

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

v2: Forgot leading slash.

.gitignore +1 -0
index 45f3cde..bd0623a 100644
@@ -54,6 +54,7 @@
 /test/fc2a85cb02ef-test
 /test/file-register
 /test/file-update
+/test/file-verify
 /test/files-exit-hang-poll
 /test/files-exit-hang-timeout
 /test/fixed-link
Signature · 1 line
2.30.2
#3 lore raw

PATCH 2/2 test/file-verify: fix 32-bit build -Werror=shift-count-overflow

In reply to Ammar Faizi

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.

---
 test/file-verify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
test/file-verify.c +1 -1
index ffedd87..cd6c4de 100644
@@ -190,7 +190,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++;
Signature · 1 line
2.30.2
maintainer Applied
#4 lore raw
In reply to Ammar Faizi
Quoted 11 lines · Ammar Faizi

- Add test/file-verify to .gitignore.
- Fix 32-bit build

----------------------------------------------------------------
Ammar Faizi (2):
.gitignore: add test/file-verify
test/file-verify: fix 32-bit build -Werror=shift-count-overflow

 .gitignore         | 1 +
 test/file-verify.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

Signature · 1 line
Jens Axboe