[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250221172415.5b632ae6@gandalf.local.home>
Date: Fri, 21 Feb 2025 17:24:15 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: 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 11:30:41 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> And yes, it's wrong in general. The problems with "x < 0" warning for
> an unsigned 'x' are deep and fundamental, and macros that take various
> types is only one (perhaps more obvious) example of how brokent that
> garbage is.
The bug I recently fixed, and I still constantly make, where this does
help, is the difference between size_t vs ssize_t. I keep forgetting that
size_t is unsigned, and I'll check a return of a function that returns
negative on error with it.
If I could just get a warning for this stupid mistake:
size_t ret;
ret = func();
if (ret < 0)
error();
I'd be very happy.
-- Steve
Powered by blists - more mailing lists