mgehre / llvm-project

The home of the clang-based implementation of lifetime safety warnings.
39 stars 4 forks source link

Smarter uniqueing for warnings #84

Open Xazax-hun opened 4 years ago

Xazax-hun commented 4 years ago

If we dereference a dangling pointer (pointee went out of scope) multiple times we will get multiple warnings. We unique warnings based on the report location. But in fact, all the errors were the same. So maybe we should have emitted only one warning per pointee out of scope. So maybe, for some warnings, we should use the notes as a uniqueing location instead of the actual warning. The clang static analyzer does something similar for leaks, instead of reporting them on every path, it reports leaks only once per allocation site.