# Re: \[PATCH\] selftests: mptcp: pm\_nl\_ctl: print sizeof() with %zu

- From: Hangbin Liu \<hidden\>
- Date: 2026-11-04 01:38:00 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/11/17857357
- Thread: https://ratatoskr.run/netdev/2026/11/17854331/t.md

```text
On Tue, Nov 03, 2026 at 10:55:06AM -0500, Sasha Levin wrote:
> On 32-bit architectures size_t is an unsigned int, and printing
> sizeof(struct nlmsgerr) with %ld warns:
> 
>   pm_nl_ctl.c:73:71: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Wformat=]
> 
> Use %zu.
> 
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> Found with a 32-bit build of the selftests with a 64-bit time_t (gcc 16
> and clang 21 with -m32 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64);
> KernelCI's 32-bit arm builds show the same warnings. The changed files
> build without format warnings there now, and the x86_64 builds don't
> change. The other selftests get the same kind of fix in separate
> patches.
> 
>  tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
> index 78180da1efcc5..36a6d39b31bbf 100644
> --- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
> +++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
> @@ -70,7 +70,7 @@ static int nl_error(struct nlmsghdr *nh)
>  	uint32_t off;
>  
>  	if (len < sizeof(struct nlmsgerr)) {
> -		error(1, 0, "netlink error message truncated %d min %ld", len,
> +		error(1, 0, "netlink error message truncated %d min %zu", len,
>  		      sizeof(struct nlmsgerr));
>  		return -1;
>  	}
> -- 
> 2.53.0
> 

Reviewed-by: Hangbin Liu <redacted>
```
