Re: [PATCH] selftests: harness: fix printing of mismatch values in __EXPECT()

From: Shuah Khan
Date: Wed Jan 08 2025 - 18:23:23 EST


On 1/8/25 14:57, Kees Cook wrote:
On Wed, Jan 08, 2025 at 07:07:57PM +0200, Dmitry V. Levin wrote:
intptr_t and uintptr_t are not big enough types on 32-bit architectures
when printing 64-bit values, resulting to the following incorrect
diagnostic output:

# get_syscall_info.c:209:get_syscall_info:Expected exp_args[2] (3134324433) == info.entry.args[1] (3134324433)

Replace intptr_t and uintptr_t with intmax_t and uintmax_t, respectively.
With this fix, the same test produces more usable diagnostic output:

# get_syscall_info.c:209:get_syscall_info:Expected exp_args[2] (3134324433) == info.entry.args[1] (18446744072548908753)

Fixes: b5bb6d3068ea ("selftests/seccomp: fix 32-bit build warnings")
Signed-off-by: Dmitry V. Levin <ldv@xxxxxxxxx>

Ah nice, thanks!

Reviewed-by: Kees Cook <kees@xxxxxxxxxx>


Thank you. Applied to linux-kselftest next for Linux 6.14-rc1.

thanks,
-- Shuah