Hacker News new | ask | show | jobs
by 0x09 2238 days ago
Though scan-build is usually the simpler option, clang itself does have an --analyze flag which writes analysis results in various formats, including the same html reports that scan-build would generate. But to see this on standard out

   clang --analyze --analyzer-output text ...
Will print the entire analysis tree in the same format as regular diagnostics.
1 comments

The only problem is the CTU mess if you're analyzing more than one file, thus the aforementioned tools' necessity.

Hopefully in a future version the kinks are ironed out and we can just use the flag without any hassle. It's like if we needed to still manually link our files with ld before compiling them instead of clang auto doing it.