[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

Justin Stitt via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 22 16:34:40 PDT 2024


JustinStitt wrote:

@efriedma-quic said:
> I'm still not happy with the AST representation here. The current representation is likely to cause unpredictable results in edge cases, and compatibility constraints mean whatever result the current version happens to produce for those cases is locked in forever. And there isn't really any good way to mitigate those issues under the current representation.
> 
> I don't want to block progress here, but I think in its current form, we're likely to end up with reported issues we can't fix.

The current design is heavily opt-in. So much so that this isn't just some compiler flag that you turn on. You have to go out of your way to design your code around this attribute, specifically marking things as wrapping with named types, etc.

So I guess the questions are: Is the current description of this attribute not clear enough? Do we think users will be confused/surprised by its behavior? What edge cases are there (in C)? Can they be fixed right now so we don't have these compatibility issues in the future?

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


More information about the cfe-commits mailing list