[cfe-dev] Using scan-build with custom checker plugins

Thomas Hauth Thomas.Hauth at cern.ch
Thu May 17 09:43:56 PDT 2012


Hi Anna,
thanks for clarifying this. I will prepare a patch with the 
functionality you proposed and submit it.

Cheers,
Thomas

On 05/16/12 19:39, Anna Zaks wrote:
> Hi Thomas,
>
> I am not aware of anyone else using scan-build with plugin checkers. I
> think the best way to implement this would be to add command line
> options to scan-build to specify the plugins and have scan-build pass
> those on to c++-analyzer. This is how other flags are supported, for
> example, see "-enable-checker". Would be great if you submit the patch
> for this to the open source codebase!
>
> Cheers,
> Anna.
>
>
> On May 16, 2012, at 5:49 AM, Thomas Hauth wrote:
>
>> Hello,
>> we implemented some custom clang Static Analyzer checkers for our needs
>> and compiled them as external modules.
>>
>> When calling clang directly, one can use "-Xclang" to pass the command
>> to load and run the checkers:
>>
>> clang++ -Xclang -load -Xclang ./MainCallChecker.so -Xclang
>> -analyzer-checker=example.MainCallChecker --analyze global_static.cpp
>>
>> This variant works fine.
>>
>> Is there a way, to still load the custom plugins when using the
>> scan-build tool on regular make files?
>>
>> As a workaround, I implemented a new environment variable named
>> "CCC_ANALYZER_PLUGINS" which is read by the c++-analyzer script and used
>> to pass the plugins to load to the clang call.
>>
>>
>> Thanks,
>> Thomas
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>


-- 

------------------------------------------------------------------------
   Thomas Hauth
   CERN
   Office: 40 3 B20
   Telephone: +41 (0)22 76 71 557
------------------------------------------------------------------------



More information about the cfe-dev mailing list