[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:15:54 PDT 2024
melver wrote:
> We could make custom types that are filtered out in an ignorelist, allowing for types to be more expressive -- without the need for annotations
Having this sort of semantic information detached from the code may cause some maintenance headaches. For example, if the type is renamed, developers have to remember to adjust the filter list as well.
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.
Just something to consider - I suspect it's much more complex to implement in Clang though. So that's a +1 for the filterlist in terms of complexity.
https://github.com/llvm/llvm-project/pull/107332
More information about the cfe-commits
mailing list