mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>
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 21:27:11 +0100	[thread overview]
Message-ID: <f85ba2f8-d611-4d68-829d-b96c45201882@t-8ch.de> (raw)
In-Reply-To: <20251109195754.GB20023@1wt.eu>

On 2025-11-09 20:57:54+0100, Willy Tarreau wrote:
> 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.

Yeah, indeed '0' is special and valid, even in C23.
My recollection was wrong. Thanks for the hint!

> > 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>

And thanks again.


Thomas

  reply	other threads:[~2025-11-09 20:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-09 19:27 Thomas Weißschuh
2025-11-09 19:57 ` Willy Tarreau
2025-11-09 20:27   ` Thomas Weißschuh [this message]
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=f85ba2f8-d611-4d68-829d-b96c45201882@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=w@1wt.eu \
    /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

all inboxes | Powered by JetHome®