[analyzer] NoStoreFuncVisitor: Suppress reports with no-store in system headers.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 5 Apr 2019 20:18:53 +0000 (20:18 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 5 Apr 2019 20:18:53 +0000 (20:18 +0000)
commit5c6fc36de89702b9096973cfc5fd9b071d9db2c5
tree6c6572a71c23b964dd171b8acba5d02e94029243
parent9d9d1b6b2ba079c83bad5a00c8189b86ef14ae03
[analyzer] NoStoreFuncVisitor: Suppress reports with no-store in system headers.

The idea behind this heuristic is that normally the visitor is there to
inform the user that a certain function may fail to initialize a certain
out-parameter. For system header functions this is usually dictated by the
contract, and it's unlikely that the header function has accidentally
forgot to put the value into the out-parameter; it's more likely
that the user has intentionally skipped the error check.

Warnings on skipped error checks are more like security warnings;
they aren't necessarily useful for all users, and they should instead
be introduced on a per-API basis.

Differential Revision: https://reviews.llvm.org/D60107

llvm-svn: 357810
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
clang/test/Analysis/Inputs/no-store-suppression.h [new file with mode: 0644]
clang/test/Analysis/no-store-suppression.cpp [new file with mode: 0644]