From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: Andrew Ballance <andrewjballance@gmail.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
John Hubbard <jhubbard@nvidia.com>,
Alexandre Courbot <acourbot@nvidia.com>,
Timur Tabi <ttabi@nvidia.com>,
Alistair Popple <apopple@nvidia.com>,
Miguel Ojeda <ojeda@kernel.org>
Subject: Re: Printing with overflow checks can cause modpost errors
Date: Fri, 12 Sep 2025 12:08:12 +0200 [thread overview]
Message-ID: <CANiq72=89-22iORBttRtNeMN1ZHzH=MRvqfS5qPufHsMx8C0ng@mail.gmail.com> (raw)
In-Reply-To: <CAH5fLgiP2DRcGy04YdsWS9+N1=_CCNEtAGrCn31vUHjnDLW9xw@mail.gmail.com>
On Fri, Sep 12, 2025 at 11:45 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> I believe this code is using an immutable reference and not just a
> pointer, so it would be UB to use it to write to `offset`, and so it
> would be valid to assume it has not changed. But I think that in most
> scenarios, Rust only optimizes using that information when the
> reference appears as a function argument, which is not the case here.
I understood Andrew as talking about the C side, i.e. a guarantee
coming from the C side.
Callers can guarantee in other ways, but I wanted to clarify that the
C const pointer doesn't really do anything.
Cheers,
Miguel
next prev parent reply other threads:[~2025-09-12 10:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 21:31 Printing with overflow checks can cause modpost errors Joel Fernandes
2025-09-12 0:27 ` Andrew Ballance
2025-09-12 2:53 ` Joel Fernandes
2025-09-12 4:08 ` Andrew Ballance
2025-09-12 8:27 ` Miguel Ojeda
2025-09-12 9:45 ` Alice Ryhl
2025-09-12 10:08 ` Miguel Ojeda [this message]
2025-09-16 10:32 ` Joel Fernandes
2025-09-16 10:48 ` Joel Fernandes
2025-09-16 18:52 ` Joel Fernandes
2025-09-17 23:18 ` Timur Tabi
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='CANiq72=89-22iORBttRtNeMN1ZHzH=MRvqfS5qPufHsMx8C0ng@mail.gmail.com' \
--to=miguel.ojeda.sandonis@gmail.com \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=andrewjballance@gmail.com \
--cc=apopple@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=ttabi@nvidia.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;
as well as URLs for NNTP newsgroup(s).