Add support for Clang Static Analyzer
For those not already aware, there is impressive functionality in Clang to perform static analysis of code:
http://clang-analyzer.llvm.org/
http://clang-analyzer.llvm.org/scan-build.html
The de facto way of invoking it is to use their "scan-build" perl script to subvert the normal configure and Makefile with an alternate CC definition.
Crossworks has its own build mechanism, though, so this approach is not useable.
I've been quite impressed with its ability to find things like obscure execution paths that can result in un-initialized variables.
Crossworks is already using quite a modern clang version with such functionality latent inside. Making the next step to take advantage of this functionality would seem a rather worthwhile one.
-
This is *not* an elaborate example, but one can appreciate how the information presented by scan-build and scan-view can add considerable insight when convoluted execution paths might lead to unintended outputs.
Show is a screenshot of what Crossworks outputs with right-click ... Tools ... Run Static Code Analyzer:
Compare the above to a screenshot of what is output with scan-view after scan-build:
Please sign in to leave a comment.
Comments
1 comment