Linux-Sparse Archive mirror
 help / color / mirror / Atom feed
From: Chris Li <sparse@chrisli.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-sparse@vger.kernel.org,
	 Ricardo Ribalda <ribalda@chromium.org>,
	Kees Cook <kees@kernel.org>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] builtin: implement __builtin_strlen() for constants
Date: Thu, 16 Oct 2025 05:05:03 -0700	[thread overview]
Message-ID: <CACePvbVG2KrGQq4cNKV=wbO5h=jp3M0RO1SdfX8kV4OukjPG8A@mail.gmail.com> (raw)
In-Reply-To: <aPCs46Sno0a4dsyK@stanley.mountain>

Thanks,

Will apply with Linus' fix up.

Chris

On Thu, Oct 16, 2025 at 1:29 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> On Wed, Oct 15, 2025 at 08:13:51AM -0700, Linus Torvalds wrote:
> > So you should add a
> >
> >     #include <string.h>
> >
> > at the top, and do something like
> >
> > -       expr->value = arg->string->length - 1;
> > +       expr->value = strlen(arg->string->data);
> >
> > in there instead, because constant strings can have embedded NUL characters.
> >
> >            Linus
>
> Ah.  Thanks.
>
> regards,
> dan carpenter
>

      reply	other threads:[~2025-10-16 12:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 13:08 [PATCH] builtin: implement __builtin_strlen() for constants Dan Carpenter
2025-10-15 15:13 ` Linus Torvalds
2025-10-16  8:29   ` Dan Carpenter
2025-10-16 12:05     ` Chris Li [this message]

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='CACePvbVG2KrGQq4cNKV=wbO5h=jp3M0RO1SdfX8kV4OukjPG8A@mail.gmail.com' \
    --to=sparse@chrisli.org \
    --cc=dan.carpenter@linaro.org \
    --cc=kees@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=ribalda@chromium.org \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).