[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)
Marco Elver via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 30 14:58:28 PDT 2024
melver wrote:
> > I wished that we could just attach attributes to type, e.g. `typedef int __attribute__((no_sanitize("signed-integer-overflow")) wrapping_int` or something. One thing here is that this should _not_ be a type modifier (like volatile and such), so it does not change the type, but that means nothing enforces it's propagated through conversions. But I suppose that the filter list has the same problem as you depend on specific type names.
>
> I have the implementation done for this and I should get the PR up soon.
>
> Then we'll have something like this:
>
> ```
> typedef int __attribute__((wraps)) wrapping_int
> ```
>
> I'll be sure to CC you 😄
Oh nice. If you have that almost done, why do you still want the filterlist? For the Linux kernel usecase, wouldn't the attribute be preferrable? My intuition tells me that maintaining a filterlist detached from the code will cause headaches, esp. during refactors or code moves (and you don't want to be the one chasing after the breakages).
https://github.com/llvm/llvm-project/pull/107332
More information about the cfe-commits
mailing list