[PATCH] D93110: [analyzer] Implement a first version of suppressions via attributes

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 17 06:24:05 PST 2020


vsavchenko added a comment.

In D93110#2458613 <https://reviews.llvm.org/D93110#2458613>, @aaron.ballman wrote:

> Have you explored how this attribute will work with clang frontend diagnostics or clang-tidy diagnostics?

Actually, this attribute is not used anywhere in the codebase (even in `clang-tidy`!).  I think that it can be used for warning suppressions as well, it is more comfortable than pragmas IMO.  However, I think that the problem of false positive or, for that matter, suppressions is much more visible with static analysis tools.

> One usability concern I have with adding [[clang::suppress]] is that users are going to want to use it to suppress all the various kinds of diagnostics and not just clang static analyzer warnings.

Documentation will explicitly state that this mechanism is for the clang static analyzer and if users would like to use it for others things as well, that would prove that it is a good approach and can be fully supported in other parts of Clang.

Additionally, I was thinking about third parties developing their own static analysis tools using Clang as a parser for C/C++/Obj-C.  They would probably also like to use this attribute.  This is one reason why we probably shouldn't complain about unknown identifiers used with this attribute.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93110/new/

https://reviews.llvm.org/D93110



More information about the cfe-commits mailing list