From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailrelay.tugraz.at (mailrelay.tugraz.at [129.27.2.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBDAD2066EE for ; Fri, 21 Feb 2025 23:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=129.27.2.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740181041; cv=none; b=NLOp1TrI2krxTaS8jrSbaFUU2pstZ3D/n5Zhg73VfbSPcVN0i3sozA20bDscviE9KmwZVcp6emxUW45hqIKVFViOJmxgdEsE0Y6Eb9ks7swd5Ku/IBSi8/WNNfYjZr//HxP3D6IqP+V6vsK3nSgcODYqzUdMTxnMY+ec1uOV03w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740181041; c=relaxed/simple; bh=QuF+YyezZll4mS5fKCVTOeni9saCkm+aBxjihJ8FwDw=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Nn9zgRPTcDJU6cznAsot65CV5D8wvuk0dUWiQLBtaYo7JlUJ55/1EebYKIBX13eH9xDI/TfL0b7mU65IWbfmns59b72a/1rYtxLwYqEaDTaysfLAd+Vq+amXr7NnyZZsQcehV+iYCQAipWDj3Ur8XSZDbJd8JRnTQacraOtSauE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tugraz.at; spf=pass smtp.mailfrom=tugraz.at; dkim=pass (1024-bit key) header.d=tugraz.at header.i=@tugraz.at header.b=W1tsNPJT; arc=none smtp.client-ip=129.27.2.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tugraz.at Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tugraz.at Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tugraz.at header.i=@tugraz.at header.b="W1tsNPJT" Received: from [192.168.0.221] (84-115-212-25.cable.dynamic.surfer.at [84.115.212.25]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Z063d5md0z1LM09; Sat, 22 Feb 2025 00:37:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4Z063d5md0z1LM09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1740181022; bh=GNxPALT6bh+xjA6a7d7X+7z7j13roE7xzn3KU3dbAo4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=W1tsNPJT1j85pi/RTog1sdwJhpG92iWrusXw8Szw+27bdhzHK0O1jez4fwOruiSr7 fLgRQoDRlsC8v75XC66IC3av0dpQCluscHTHFL4oIjOzDNjeQTXBilwOyI4nF2DZnt OKc84ejkKIwTXzL+SHkeEm6aKZsjZ53CVV/hmfUo= Message-ID: Subject: Re: Rust kernel policy From: Martin Uecker To: Steven Rostedt , Linus Torvalds Cc: linux-kernel@vger.kernel.org, ksummit@lists.linux.dev Date: Sat, 22 Feb 2025 00:37:01 +0100 In-Reply-To: <20250221172415.5b632ae6@gandalf.local.home> References: <326CC09B-8565-4443-ACC5-045092260677@zytor.com> <2025021954-flaccid-pucker-f7d9@gregkh> <4e316b01634642cf4fbb087ec8809d93c4b7822c.camel@tugraz.at> <2025022024-blooper-rippling-2667@gregkh> <1d43700546b82cf035e24d192e1f301c930432a3.camel@tugraz.at> <2025022042-jot-favored-e755@gregkh> <61a7e7db786d9549cbe201b153647689cbe12d75.camel@tugraz.at> <20250221124304.5dec31b2@gandalf.local.home> <6b3e4d3bdc9b6efd69068e5b22cfd05d370aed19.camel@tugraz.at> <20250221172415.5b632ae6@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TUG-Backscatter-control: G/VXY7/6zeyuAY/PU2/0qw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: 0.0 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 Am Freitag, dem 21.02.2025 um 17:24 -0500 schrieb Steven Rostedt: > On Fri, 21 Feb 2025 11:30:41 -0800 > Linus Torvalds wrote: >=20 > > 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. >=20 > 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. >=20 > If I could just get a warning for this stupid mistake: >=20 > size_t ret; >=20 > ret =3D func(); > if (ret < 0) > error(); >=20 >=20 > I'd be very happy. >=20 GCC has this warning, it is called -Wtype-limits https://godbolt.org/z/M787vjhfo It is activated by -Wextra. (anyway, not at all related to my proposal) Martin