From: Ted Kremenek Date: Fri, 29 Jun 2012 20:44:58 +0000 (+0000) Subject: Tweak insecureAPI analyzer checks to have the ability to be individually disabled. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f50875f3bb5174fe669a7a08790d76e67f4a7cd;p=clang Tweak insecureAPI analyzer checks to have the ability to be individually disabled. The solution is a bit inefficient: it creates N checkers, one for each check, and each check does a dispatch on the function name. This is redundant, but we can fix this once we have the proper ability to enable/disable subchecks. Fixes . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159459 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp index dde90713ce..053b83f894 100644 --- a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp @@ -379,13 +379,6 @@ void WalkAST::checkCall_getpw(const CallExpr *CE, const FunctionDecl *FD) { //===----------------------------------------------------------------------===// void WalkAST::checkCall_mktemp(const CallExpr *CE, const FunctionDecl *FD) { - if (!filter.check_mktemp) { - // Fall back to the security check of looking for enough 'X's in the - // format string, since that is a less severe warning. - checkCall_mkstemp(CE, FD); - return; - } - const FunctionProtoType *FPT = dyn_cast(FD->getType().IgnoreParens()); if(!FPT) @@ -769,8 +762,9 @@ public: } #define REGISTER_CHECKER(name) \ +namespace { class Checker_##name : public SecuritySyntaxChecker {}; }\ void ento::register##name(CheckerManager &mgr) {\ - mgr.registerChecker()->filter.check_##name = true;\ + mgr.registerChecker()->filter.check_##name = true;\ } REGISTER_CHECKER(gets)