[LTP] [PATCH 1/2] mq_timedreceive01: Fix different signedness error on 32bit

Petr Vorel pvorel@suse.cz
Tue Nov 12 18:18:30 CET 2024


warning: comparison of integer expressions of different signedness:
‘unsigned int’ and ‘long int’ [-Wsign-compare].

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
index 3870b4087a..d4f447d047 100644
--- a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
+++ b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
@@ -183,7 +183,7 @@ static void do_test(unsigned int i)
 		return;
 	}
 
-	if (tc->len != TST_RET) {
+	if ((long)tc->len != TST_RET) {
 		tst_res(TFAIL, "mq_timedreceive() wrong length %ld, expected %u",
 			TST_RET, tc->len);
 		return;
-- 
2.47.0



More information about the ltp mailing list