[cfe-dev] Adding a new static analysis checker by default
Aditya K
hiraditya at msn.com
Thu Apr 23 07:19:48 PDT 2015
Actually, you can make any checker as a default by enabling it in Tools.cpp (http://clang.llvm.org/doxygen/Tools_8cpp_source.html)
02729 // Add default argument set.
02730 if (!Args.hasArg(options::OPT__analyzer_no_default_checks)) {
02731 CmdArgs.push_back("-analyzer-checker=core");
02732
02733 if (!IsWindowsMSVC)
02734 CmdArgs.push_back("-analyzer-checker=unix");
02735
02736 if (getToolChain().getTriple().getVendor() == llvm::Triple::Apple)
02737 CmdArgs.push_back("-analyzer-checker=osx");
02738
02739 CmdArgs.push_back("-analyzer-checker=deadcode");
02740
02741 if (types::isCXX(Inputs[0].getType()))
02742 CmdArgs.push_back("-analyzer-checker=cplusplus");
02743
02744 // Enable the following experimental checkers for testing.
02745 CmdArgs.push_back(
02746 "-analyzer-checker=security.insecureAPI.UncheckedReturn");
02747 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.getpw");
02748 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.gets");
02749 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mktemp");
02750 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mkstemp");
02751 CmdArgs.push_back("-analyzer-checker=security.insecureAPI.vfork");
// Add your checker here to enable it by default.
02752 }
I think the checkers are classified according to their functionality, and not whether they should be default or not.
hth,
-Aditya
> From: hong.gyu.kim at lge.com
> To: adrian.neumann at siemens.com; cfe-dev at cs.uiuc.edu
> Date: Thu, 23 Apr 2015 21:17:07 +0900
> Subject: Re: [cfe-dev] Adding a new static analysis checker by default
>
> Right, the problem was that I put the checker as an alpha checker.
> I have moved to core checker list, then it works fine now.
> Thank you very much.
>
> Honggyu
>
> > -----Original Message-----
> > From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of Neumann, Adrian
> > Sent: Thursday, April 23, 2015 6:30 PM
> > To: cfe-dev at cs.uiuc.edu
> > Subject: Re: [cfe-dev] Adding a new static analysis checker by default
> >
> > Did you follow the steps described in the developer's manual?
> >
> > > http://clang-analyzer.llvm.org/checker_dev_manual.html#registration
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150423/53e8fd05/attachment.html>
More information about the cfe-dev
mailing list