Skip to content
Snippets Groups Projects
Commit b3813170 authored by Ammar Faizi's avatar Ammar Faizi Committed by Jens Axboe
Browse files

test/timeout-overflow: Fix `-Werror=maybe-uninitialized`

Fix this:
```
  In file included from timeout-overflow.c:12:
  timeout-overflow.c: In function ‘test_timeout_overflow’:
  ../src/include/liburing.h:406:9: error: ‘num’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    406 |         io_uring_prep_rw(IORING_OP_TIMEOUT, sqe, -1, ts, 1, count);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  timeout-overflow.c:104:26: note: ‘num’ was declared here
    104 |                 unsigned num;
        |                          ^~~
```

Fixes: a4b46553

 ("Add test for overflow of timeout request's sequence")
Cc: yangerkun <yangerkun@huawei.com>
Signed-off-by: default avatarAmmar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/BULrcXMbevM-ammarfaizi2@gnuweeb.org


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 49e3095e
Branches
Tags
No related merge requests found
......@@ -101,7 +101,7 @@ static int test_timeout_overflow(void)
msec_to_ts(&ts, TIMEOUT_MSEC);
for (i = 0; i < 4; i++) {
unsigned num;
unsigned num = 0;
sqe = io_uring_get_sqe(&ring);
switch (i) {
case 0:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment