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

Wei Gao via ltp
2024-11-13T01:37:52Z

On Tue, Nov 12, 2024 at 06:18:30PM +0100, Petr Vorel wrote:
> 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;
Reviewed-by: Wei Gao <wegao@suse.com>
> --
> 2.47.0
>