[cfe-dev] VS2010 Clangification Script

Ted Kremenek kremenek at apple.com
Mon Mar 15 21:56:39 PDT 2010


Hi Clark,

This is a really nice step.  I'm not super fluent in Python, but I did find the code fairly intuitive.  Some of the spacing between conditionals doesn't seem as tight as I am use to seeing, e.g. the extra lines at line 110, but overall it simple and readable.

The approach is a good first step, and should be useful for small VS projects.  This approach will run into issues if any of the following happen:

(1) Intermediate files are needed to be generated by the build in order to compile other files

(2) Any of the source files take different compiler flags

Both (1) and (2) are the reason scan-build actually interposes itself in a regular build.  That is the the ultimate truth of what the compiler really sees, and that's what's needed for accurately processing source files.

I have little experience with VS these days, and don't know what hooks it has to make it more extensible.  I certainly would like to see more support for the analyzer on Windows, and would be happy to post this script on the clang-analyzer website if you were so kind to provide a brief writeup of how to use it.

Ted

On Mar 8, 2010, at 5:56 PM, Clark Gaebel wrote:

> Because scan-build only works with gcc-like compilers, MSVC seems awfully lacking. As such, I wrote a little (~100 LOC) script to scan VS2010 project files and run the appropriate clang based on the input.
> 
> I've attached the script. How can I make it available to the rest of the world?
> 
> Also - code review. How does that work here? Python's cool, but I'm by no means the best at it.
> 
> Thanks,
> -Clark
> <clangify.py>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list