Compiling with -O0 revealed that compilers are too smart and complain about io_uring_query_opcode not being initialised. It's not an issue as it's passed to the kernel to be filled in, nevertheless, let's silence the warnings. Signed-off-by: Pavel Begunkov --- test/ring-query.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/ring-query.c b/test/ring-query.c index 971fd9ba..d0aa396c 100644 --- a/test/ring-query.c +++ b/test/ring-query.c @@ -36,7 +36,7 @@ static int io_uring_query(struct io_uring *ring, struct io_uring_query_hdr *arg) static int test_basic_query(void) { - struct io_uring_query_opcode op; + struct io_uring_query_opcode op = {}; struct io_uring_query_hdr hdr = { .query_op = IO_URING_QUERY_OPCODES, .query_data = uring_ptr_to_u64(&op), @@ -76,7 +76,7 @@ static int test_basic_query(void) static int test_invalid(void) { int ret; - struct io_uring_query_opcode op; + struct io_uring_query_opcode op = {}; struct io_uring_query_hdr invalid_hdr = { .query_op = -1U, .query_data = uring_ptr_to_u64(&op), @@ -119,7 +119,7 @@ static int test_invalid(void) static int test_chain(void) { int ret; - struct io_uring_query_opcode op1, op2, op3; + struct io_uring_query_opcode op1 = {}, op2 = {}, op3 = {}; struct io_uring_query_hdr hdr3 = { .query_op = IO_URING_QUERY_OPCODES, .query_data = uring_ptr_to_u64(&op3), @@ -163,7 +163,7 @@ static int test_chain(void) static int test_chain_loop(void) { int ret; - struct io_uring_query_opcode op1, op2; + struct io_uring_query_opcode op1 = {}, op2 = {}; struct io_uring_query_hdr hdr2 = { .query_op = IO_URING_QUERY_OPCODES, .query_data = uring_ptr_to_u64(&op2), @@ -201,7 +201,7 @@ static int test_chain_loop(void) static int test_compatibile_shorter(void) { int ret; - struct io_uring_query_opcode_short op; + struct io_uring_query_opcode_short op = {}; struct io_uring_query_hdr hdr = { .query_op = IO_URING_QUERY_OPCODES, .query_data = uring_ptr_to_u64(&op), @@ -234,7 +234,7 @@ static int test_compatibile_shorter(void) static int test_compatibile_larger(void) { int ret; - struct io_uring_query_opcode_large op; + struct io_uring_query_opcode_large op = {}; struct io_uring_query_hdr hdr = { .query_op = IO_URING_QUERY_OPCODES, .query_data = uring_ptr_to_u64(&op), -- 2.49.0