Hacker News new | ask | show | jobs
by flohofwoe 2244 days ago
Slightly tangential to what the article is about, but at least in the C/C++ world, the most important change to make static analysis popular for "the rest of us" was probably Xcode's decision to integrate clang analyzer right into the Xcode UI under a menu item (Xcode doesn't do many things right, but this is definitely one of the very good features).

This way, analyzing the code is a simple "button press" and works out of the box on every Xcode project.

Soon after, Microsoft followed suit in Visual Studio (even though in my experience, the MS analyzer doesn't catch quite as many things as the clang analyzer).

Before that, static analyzers were those no doubt useful but obscure "magic tools" which were very hard to integrate into an existing build process.

Even the most useful tool will be ignored when it is hard to use.

1 comments

Somewhat annoyingly, the static analyzer that ships with Xcode doesn't seem to be packaged separately as in the command line tools…
Hmm, command-line clang accepts a --analyze option here ("Apple clang version 11.0.0"), and this seems to give additional output over the regular warnings. I'm not sure if that's the same thing as the analyzer integrated into Xcode, but some sort of static analyzer seems to be there.
Oh, I will have to try that. Thanks for sharing!
Same with the profiling tools.