[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72=89-22iORBttRtNeMN1ZHzH=MRvqfS5qPufHsMx8C0ng@mail.gmail.com>
Date: Fri, 12 Sep 2025 12:08:12 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Andrew Ballance <andrewjballance@...il.com>, Joel Fernandes <joelagnelf@...dia.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
John Hubbard <jhubbard@...dia.com>, Alexandre Courbot <acourbot@...dia.com>, Timur Tabi <ttabi@...dia.com>,
Alistair Popple <apopple@...dia.com>, Miguel Ojeda <ojeda@...nel.org>
Subject: Re: Printing with overflow checks can cause modpost errors
On Fri, Sep 12, 2025 at 11:45 AM Alice Ryhl <aliceryhl@...gle.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
Powered by blists - more mailing lists