Question about scan-build

Hello Everyone!

I am writing a checker to check virtual call during ctor/dtor. I change the code in the VirtualcallChecker.cpp and compile it, then I use this command “./build/bin/clang -cc1 -analyze -analyzer-checker=optin.cplusplus.VirtualCall test.cpp” to run the checker on the testcase I write and it works as I expect.

After that, I start to test the checker on real world code and I am using the scan-build to check the build of Mozilla. The command I use is “…/./build/bin/scan-build -enable-checker optin.cplusplus.VirtualCall ./mach build”. I use the checker I wrote to check the build of Mozilla, the message of the warnings are the message in the previous virtual call checker, not the message I wrote in the current checker and it seems the scan-build enable the previous virtual call checker not the checker I wrote. Even when I remove the function of checkPreCall() which issues warning for the checker, the scan-build also produce the same result. I don’t know why. Is it possible that after compile the checker, we should do something to include the checker in the scan-build?

Look forward to your help

It's probably just using the wrong clang binary that is still using
the original checker. The documentation for the scan-build flag
`--use-analyzer ` on this page[1] should help you. And you can try
running in verbose mode or with strace to see what binary it uses.

- Raphael


Thank you very much!

2017年7月23日星期日,Raphael Isemann <> 写道: