[clang] [clang] Implement -fstrict-bool (PR #160790)

Andrew Pinski via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 31 00:43:10 PST 2025


=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/160790 at github.com>


pinskia wrote:

> I apologize if you have considered this already, there was a lot of context to catch up on and I only became aware of this proposal... now?

There was an rfc on discourse. But anyways I think you misunderstood the proposal. Bool as defined will continue be writing out 0/1 that is not going to change. What is being allowed is when reading in (or pass through function arguments) the value of true/false. Basically what was undefined is changed to be defined behavior. Either truncation (&1) or nonzero (!=0) depending on the option setting. There is no abi change here is what was defined before is still the same with either settings.

Note the way I am going to have this implement in gcc is going to be frontend independent even. 



https://github.com/llvm/llvm-project/pull/160790


More information about the cfe-commits mailing list