From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] tools/nolibc: avoid using plain integer as NULL pointer
Date: Sun, 9 Nov 2025 20:57:54 +0100 [thread overview]
Message-ID: <20251109195754.GB20023@1wt.eu> (raw)
In-Reply-To: <20251109-nolibc-sparse-v1-1-02256638a99c@weissschuh.net>
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@intel.com>
> Closes: https://lore.kernel.org/r/202509261452.g5peaXCc-lkp@intel.com/
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
For the patch: Acked-by: Willy Tarreau <w@1wt.eu>
Thanks,
Willy
next prev parent reply other threads:[~2025-11-09 19:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-09 19:27 [PATCH] tools/nolibc: avoid using plain integer as NULL pointer Thomas Weißschuh
2025-11-09 19:57 ` Willy Tarreau [this message]
2025-11-09 20:27 ` Thomas Weißschuh
2025-11-10 12:16 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251109195754.GB20023@1wt.eu \
--to=w@1wt.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox