From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E8ACA33CC1 for ; Fri, 24 Nov 2023 22:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GSk6hSi/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC5D4C433C8; Fri, 24 Nov 2023 22:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700864714; bh=UVqEokoW3Mp5F/y0n80U+DOl8ho4OJ0yobLjlPYXiyM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GSk6hSi/85W4RQvniNd9lM+AtALAyDq1nolpAZyA6yRrJNmQamMoRxutW3BI/ObLm CF94r1LAGZW5LGt6R/GFIYTaSZNN0XTFMXN45azm1kLuXvkkMuzL1UWz5aZRpTUeLI 6ihZpDBIGTn8jtd1LW91Id7KB9q/HDa+h12a39Pwb89oYoV99XHrqoXcOP5cQDpRap 1S3SzigjSEQSEPDJXiiBZyqW6AoF3zKCGvYOYFnqZ5YJ/ttGyTNCyLJU2Rz6CpRrex cALEsgNAxLSb7acqtkabCrOI4wQb90wJtQ+vn3CfB+GxBei0xY7Ha3L8xYHesOOrVf Frrai13Pf8WJw== Date: Fri, 24 Nov 2023 23:25:11 +0100 From: Alejandro Colomar To: Jonny Grant Cc: linux-man Subject: Re: NULL safety Message-ID: References: <20231109031345.245703-1-mattlloydhouse@gmail.com> <20231110160602.352085-1-mattlloydhouse@gmail.com> <17ca7ec2-b542-4043-a311-bc0c2a7ddf78@jguk.org> Precedence: bulk X-Mailing-List: linux-man@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y7u8QIpti8Gi/QVX" Content-Disposition: inline In-Reply-To: --y7u8QIpti8Gi/QVX Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Fri, 24 Nov 2023 23:25:11 +0100 From: Alejandro Colomar To: Jonny Grant Cc: linux-man Subject: Re: NULL safety Hi Jonny, On Sat, Nov 18, 2023 at 11:21:00PM +0000, Jonny Grant wrote: > I saw Christopher Bazley was talking about this. As I understand it, _Non= null is milder than attribute nonnull. _Nonnull probably helps with static = analysis, but doesn't optimize out any code checking if(ptr =3D=3D NULL) re= turn -1; >=20 > Saw this, did you get traction with your proposal? >=20 > https://discourse.llvm.org/t/iso-c3x-proposal-nonnull-qualifier/59269?pag= e=3D2 I didn't follow up with that. I'd first like to be able to try Clang's static analyzer with _Nullable, to be able to play with it. An _Optional qualifier would only be usable by something like -fanalyzer, or Clang's analyzer, since it needs to avoid false positives that are quite complex. It's not a warning that you'd want in -Wall. And since Clang's analyzer isn't easy to use, I'm not working on that until they make it easier. Cheers, Alex --=20 --y7u8QIpti8Gi/QVX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmVhIscACgkQnowa+77/ 2zJHfQ//cAtSO85pv/UNhpszeqmmllCks6K+tTsdccaRhkAAKy/Tyh/k++s0d3Ui 6muGZQ0gQO0YqHDjyAiYga3H4jyq1FwlrbNTmPww5i+dPymEmBULgPk1ZJVnRqqC tB50ndxdkh+3XbPVw4jxNKhi3rKatfHQ8T/DeixYAkzxlUDPfaxoea5mfEamEczT gn4EZA6wGPGc3jorznTzwKzoqhNExDjQfyotRyVU81s+7GN9k4sSXKGLVuLkZ9Kl a4efvtFaiPA6eY3jHNgYfUnEPaSwUHnVzGhneiam/RQeJCbJiHruEw97P4hnqUzT +1+4KB0GULtOctq5f+bnoyoPkeaYS7tcVVhy36Q+QNfQFsVx5ctn0poVEN4nuo3O UgJpfdkJYbpowPo5hMJYA6ImwG/dVXjv1VJkm4HKB3iHWiz9VFug/t8rmRd+YWZF dPTdExK5a72Cw+WTGkfZMaR1U6Q1W0GwfsyPmgJESEE8ilAYq7aSpQMlGuWPRF2y 5g6Gw+63k2VSugRzj2EJ9JorMsJwK936ojtvmo8UWDGXpEX/79yFKkWVEC/yKDqV Q97Lz606OdqPH7mBMbsn4kNep+Ai+4aSg5HoU6DbKGg8+YAToW2Hrx260iRPArPf UpfdvxkBkruXHneqaaYc8+QOwxlMXRjbh5dIq4wxur4/su9E7Nk= =sr2A -----END PGP SIGNATURE----- --y7u8QIpti8Gi/QVX--