Question about scan-build

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Question about scan-build

Sumner, Brian via cfe-dev
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
Regards,
Xin

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about scan-build

Sumner, Brian via cfe-dev
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

[1] https://clang-analyzer.llvm.org/scan-build.html


2017-07-23 5:45 GMT+02:00 Xin Wang via cfe-dev <[hidden email]>:

> 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
> Regards,
> Xin
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about scan-build

Sumner, Brian via cfe-dev
Thank you very much!

2017年7月23日星期日,Raphael Isemann <[hidden email]> 写道:
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

[1] https://clang-analyzer.llvm.org/scan-build.html


2017-07-23 5:45 GMT+02:00 Xin Wang via cfe-dev <<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;cfe-dev@lists.llvm.org&#39;)">cfe-dev@...>:
> 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
> Regards,
> Xin
>
> _______________________________________________
> cfe-dev mailing list
> <a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;cfe-dev@lists.llvm.org&#39;)">cfe-dev@...
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...