Is the Clang Static Analyzer Enough?

I am new to iphone and objective-c and want to ask if Clan Static Analyzer is enough to get rid of memory leaks? I personally found that the xcode Leakage tool is quite difficult to use, in addition, I saw some articles in which it reads that it will always show memory leaks, even if there are no real leaks.

If I don't have warnings from the clang parser, does that mean I have no memory leaks? Or do I need to check it somehow else?

What do you think? Many thanks.

+4
source share
3 answers

If you use the built-in assembly and analysis, you can get better results by downloading the real scan assembly and including all the checks.

http://www.loufranco.com/blog/files/scan-build-better-than-build-analyze.html

But this is still not enough. You should check for leaks using runtime analysis. If you follow the very simple rules of alloc / keep / release, you can get away with it (or so close that the Leaks tool becomes much easier to handle).

+2
source

No, it is not. CSA is a static analysis tool, that is, it can only catch things that could be reasoned at compile time. For this, he is also not perfect, far from him. This will definitely not replace Tools. However, the CSA will help you recall things in the rules and other potential problems.

+3
source

No, a static analyzer is one of the tools that is convenient for you, but you should not rely only on it.

Tools, and in particular leak detection and memory isolation tools, are great ways to detect leaks. A memory allocation tool can help you find leaks that cannot be leaked, because it can show you the total memory usage, if you notice that it is growing, but never descending after you finish the task, you can start searching for a possible leaks ...

+1
source

All Articles