Clang Static Analyzer Question about Plists

Hello all,

I am Trevor Huang, a student at University of Pennsylvania and one of my classmates, Gianluca Gross, recently asked some questions about Clang Static Analyzer for our senior design project. He forwarded us some responses from Alexey Sidorin and Gabor Horvath, so thank you so much for the assistance!

One recommendation given to help us in our project is to use the plist output from scan-build instead of the html output for our parsing. I was looking through the contents of the plist and found that statements such “Taking true branch,” and other statements in the bug trace that are in gray (instead of yellow) in the html report does not appear to be present in the plist format. I was wondering where those statements come from and if there is an easy way for me to include them if I only read the plist output.

Any and all help would be greatly appreciated. Thank you again!



If you’re building automation, I highly encourage you to consider using the new Sarif output format.



Yeah, plist format is slightly different. Instead of grey notes that describe control flow as text, it describes control flow as “arrows” from one point in the source code to another. Eg., instead of writing “Taking true branch…” it’d list two (file, line, column) triples: one at the end of the branch condition, the other at the beginning of the true branch, and you can imagine this as an arrow from the first source location to the second source location. You can see how it’s supposed to look on the top screenshot at Hmm, there doesn’t seem to be a way to override this decision right now. You can try tweaking PlistDiagnostics::getGenerationScheme(), i.e. change Extensive to Minimal, but i can’t promise it won’t crash when it tries to generate anything.