Re: [PATCH] tools/nolibc: avoid using plain integer as NULL pointer
From: Willy Tarreau
Date: Sun Nov 09 2025 - 14:58:16 EST
Hi Thomas,
On Sun, Nov 09, 2025 at 08:27:29PM +0100, Thomas Weißschuh wrote:
> The integer zero should not be used as NULL pointer.
> It is invalid and sparse will complain about it.
>
> Use proper NULL pointers instead.
Huh ? I've been using that for decades and seeing it everywhere. That's
quite bizarre, 0 is perfectly valid as a pointer. Ah, here it is, in
C99:6.3.2.3:
An integer constant expression with the value 0, or such an expression
cast to type void *, is called a null pointer constant.
The change is small, so if it hurts sparse, I'm fine with changing it,
but at least the commit message should be adjusted to say that sparse
doesn't like it and not that it's not valid.
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/r/202509261452.g5peaXCc-lkp@xxxxxxxxx/
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
For the patch: Acked-by: Willy Tarreau <w@xxxxxx>
Thanks,
Willy