From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Pavel Begunkov <[email protected]>,
io-uring Mailing List <[email protected]>,
zhangyi <[email protected]>, yangerkun <[email protected]>,
Ammar Faizi <[email protected]>
Subject: [PATCH liburing 2/2] test/timeout-overflow: Fix `-Werror=maybe-uninitialized`
Date: Mon, 18 Oct 2021 19:46:01 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
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 <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
test/timeout-overflow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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:
--
2.30.2
next prev parent reply other threads:[~2021-10-18 12:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 12:45 [PATCHSET liburing 0/2] Small fixes for tests Ammar Faizi
2021-10-18 12:46 ` [PATCH liburing 1/2] test/timeout: Fix `-Werror=maybe-uninitialized` Ammar Faizi
2021-10-18 12:46 ` Ammar Faizi [this message]
2021-10-18 12:54 ` [PATCHSET liburing 0/2] Small fixes for tests Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox