summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmmar Faizi <ammar.faizi@students.amikom.ac.id>2021-10-18 19:46:01 +0700
committerJens Axboe <axboe@kernel.dk>2021-10-18 06:53:58 -0600
commitb3813170f9f24f9e18f068a7a1e29747417e360c (patch)
treedabb9784ae114c7c989fa81f479dd95b773a28d1
parent49e3095eb27febf4dd2639430cb554a5c694ccf9 (diff)
downloadliburing-b3813170f9f24f9e18f068a7a1e29747417e360c.tar.gz
liburing-b3813170f9f24f9e18f068a7a1e29747417e360c.tar.bz2
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: a4b465536021ee9c4d6d450a9461ddfc116d08b1 ("Add test for overflow of timeout request's sequence") Cc: yangerkun <yangerkun@huawei.com> Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id> Link: https://lore.kernel.org/r/BULrcXMbevM-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/timeout-overflow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/timeout-overflow.c b/test/timeout-overflow.c
index f952f80..671f171 100644
--- a/test/timeout-overflow.c
+++ b/test/timeout-overflow.c
@@ -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: