[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250223164202.550f14b8@pumpkin>
Date: Sun, 23 Feb 2025 16:42:02 +0000
From: David Laight <david.laight.linux@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, Martin Uecker <uecker@...raz.at>,
Dan Carpenter <dan.carpenter@...aro.org>, Greg KH
<gregkh@...uxfoundation.org>, Boqun Feng <boqun.feng@...il.com>, "H. Peter
Anvin" <hpa@...or.com>, Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Christoph Hellwig <hch@...radead.org>, rust-for-linux
<rust-for-linux@...r.kernel.org>, David Airlie <airlied@...il.com>,
linux-kernel@...r.kernel.org, ksummit@...ts.linux.dev
Subject: Re: Rust kernel policy
On Fri, 21 Feb 2025 15:04:04 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Fri, 21 Feb 2025 at 14:23, Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > If I could just get a warning for this stupid mistake:
> >
> > size_t ret;
> >
> > ret = func();
> > if (ret < 0)
> > error();
>
> Note that my main beef with the crazy compiler warning is that it
> literally triggers for *RANGE CHECKS*.
>
> IOW, it's literally the "if (a < 0 || a > XYZ)" thing that absolutely
> MUST NOT WARN. EVER. If it does, the compiler is broken.
The other one is where it already knows the code is being discarded.
I suspect it even warns for:
unsigned int x;
if (1 || x < 0) ...
You can't even escape with Generic (a switch statement based on the type
of a variable). All the options have to compile with all the types.
David
Powered by blists - more mailing lists