blob: 6cfdaae4bd2e5cfc20215587b850eaab512c0c67 [file] [log] [blame]
Ted Kremenek591b9072009-06-08 21:21:24 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4<head>
5 <title>Available Checks</title>
6 <link type="text/css" rel="stylesheet" href="menu.css" />
7 <link type="text/css" rel="stylesheet" href="content.css" />
Ted Kremenekf4aed5f2010-02-12 21:05:44 +00008 <script type="text/javascript" src="scripts/menu.js"></script>
Ted Kremenek591b9072009-06-08 21:21:24 +00009</head>
10<body>
11
Ted Kremenek8bebc6e2010-02-09 23:05:59 +000012<div id="page">
Ted Kremenek591b9072009-06-08 21:21:24 +000013<!--#include virtual="menu.html.incl"-->
14
15<div id="content">
16
17<h1>Available Checks</h1>
18
Anna Zaks0e5df1a2011-11-05 05:20:54 +000019<h3>The list of the checks the analyzer performs by default</h3>
20<p>
21<table border="0" cellpadding="3" cellspacing="3" width="100%">
22<!-- <tr>
23<th><h4>Checker Name</h4></th>
24<th><h4>Description</h4></th>
25</tr>-->
26<tr>
27<td width="20%"><b>core.AdjustedReturnValue</b></td><td>Check to see if the return value of a function call is different than the caller expects (e.g., from calls through function pointers).</td>
28</tr>
29<tr>
30<td width="20%"><b>core.AttributeNonNull</b></td><td>Check for null pointers passed as arguments to a function whose arguments are marked with the 'nonnull' attribute.</td>
31</tr>
32<tr>
33<td width="20%"><b>core.CallAndMessage</b></td><td>Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers).</td>
34</tr>
35<tr>
36<td width="20%"><b>core.DivideZero</b></td><td>Check for division by zero.</td>
37</tr>
38<tr>
39<td width="20%"><b>core.NullDereference</b></td><td>Check for dereferences of null pointers.</td>
40</tr>
41<tr>
42<td width="20%"><b>core.StackAddressEscape</b></td><td>Check that addresses to stack memory do not escape the function.</td>
43</tr>
44<tr>
45<td width="20%"><b>core.UndefinedBinaryOperatorResult</b></td><td>Check for undefined results of binary operators.</td>
46</tr>
47<tr>
48<td width="20%"><b>core.VLASize</b></td><td>Check for declarations of VLA of undefined or zero size.</td>
49</tr>
50<tr>
51<td width="20%"><b>core.builtin.BuiltinFunctions</b></td><td>Evaluate compiler builtin functions (e.g., alloca()).</td>
52</tr>
53<tr>
54<td width="20%"><b>core.builtin.NoReturnFunctions</b></td><td>Evaluate "panic" functions that are known to not return to the caller.</td>
55</tr>
56<tr>
57<td width="20%"><b>core.uninitialized.ArraySubscript</b></td><td>Check for uninitialized values used as array subscripts.</td>
58</tr>
59<tr>
60<td width="20%"><b>core.uninitialized.Assign</b></td><td>Check for assigning uninitialized values.</td>
61</tr>
62<tr>
63<td width="20%"><b>core.uninitialized.Branch</b></td><td>Check for uninitialized values used as branch conditions.</td>
64</tr>
65<tr>
66<td width="20%"><b>core.uninitialized.CapturedBlockVariable</b></td><td>Check for blocks that capture uninitialized values.</td>
67</tr>
68<tr>
69<td width="20%"><b>core.uninitialized.UndefReturn</b></td><td>Check for uninitialized values being returned to the caller.</td>
70</tr>
71<tr>
72<td width="20%"><b>deadcode.DeadStores</b></td><td>Check for values stored to variables that are never read afterwards.</td>
73</tr>
74<tr>
75<td width="20%"><b>deadcode.IdempotentOperations</b></td><td>Warn about idempotent operations.</td>
76</tr>
77<tr>
78<td width="20%"><b>osx.API</b></td><td>Check for proper uses of various Mac OS X APIs.</td>
79</tr>
80<tr>
81<td width="20%"><b>osx.AtomicCAS</b></td><td>Evaluate calls to OSAtomic functions.</td>
82</tr>
83<tr>
84<td width="20%"><b>osx.SecKeychainAPI</b></td><td>Check for proper uses of Secure Keychain APIs.</td>
85</tr>
86<tr>
87<td width="20%"><b>osx.cocoa.AtSync</b></td><td>Check for null pointers used as mutexes for @synchronized.</td>
88</tr>
89<tr>
90<td width="20%"><b>osx.cocoa.ClassRelease</b></td><td>Check for sending 'retain', 'release', or 'autorelease' directly to a Class.</td>
91</tr>
92<tr>
93<td width="20%"><b>osx.cocoa.IncompatibleMethodTypes</b></td><td>Warn about Objective-C method signatures with type incompatibilities.</td>
94</tr>
95<tr>
96<td width="20%"><b>osx.cocoa.NSAutoreleasePool</b></td><td>Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode.</td>
97</tr>
98<tr>
99<td width="20%"><b>osx.cocoa.NSError</b></td><td>Check usage of NSError** parameters.</td>
100</tr>
101<tr>
102<td width="20%"><b>osx.cocoa.NilArg</b></td><td>Check for prohibited nil arguments to ObjC method calls.</td>
103</tr>
104<tr>
105<td width="20%"><b>osx.cocoa.RetainCount</b></td><td>Check for leaks and improper reference count management.</td>
106</tr>
107<tr>
108<td width="20%"><b>osx.cocoa.UnusedIvars</b></td><td>Warn about private ivars that are never used.</td>
109</tr>
110<tr>
111<td width="20%"><b>osx.cocoa.VariadicMethodTypes</b></td><td>Check for passing non-Objective-C types to variadic methods that expect only Objective-C types.</td>
112</tr>
113<tr>
114<td width="20%"><b>osx.coreFoundation.CFError</b></td><td>Check usage of CFErrorRef* parameters.</td>
115</tr>
116<tr>
117<td width="20%"><b>osx.coreFoundation.CFNumber</b></td><td>Check for proper uses of CFNumberCreate.</td>
118</tr>
119<tr>
120<td width="20%"><b>osx.coreFoundation.CFRetainRelease</b></td><td>Check for null arguments to CFRetain/CFRelease.</td>
121</tr>
122<tr>
123<td width="20%"><b>unix.API</b></td><td>Check calls to various UNIX/Posix functions.</td>
124</tr>
Anna Zaks0e5df1a2011-11-05 05:20:54 +0000125</table>
126
127<p>In addition to these the analyzer contains numerous experimental (beta) checkers.</p>
128
129<h3>Writeups with examples of some of the bugs that the analyzer finds</h3>
Ted Kremenek591b9072009-06-08 21:21:24 +0000130
131<ul>
132<li><a href="http://www.mobileorchard.com/bug-finding-with-clang-5-resources-to-get-you-started/">Bug Finding With Clang: 5 Resources To Get You Started</a></li>
133<li><a href="http://fruitstandsoftware.com/blog/index.php/2008/08/finding-memory-leaks-with-the-llvmclang-static-analyzer/#comment-2">Finding Memory Leaks With The LLVM/Clang Static Analyzer</a></li>
134<li><a href="http://www.therareair.com/howto-static-analyze-your-objective-c-code-using-the-clang-static-analyzer-tool-gallery/">HOWTO: Static Analyze Your Objective-C Code Using the Clang Static Analyzer Tool Gallery</a></li>
135<li><a href="http://www.rogueamoeba.com/utm/2008/07/14/the-clang-static-analyzer/">Under the Microscope - The Clang Static Analyzer</a></li>
136<li><a href="http://www.mikeash.com/?page=pyblog/friday-qa-2009-03-06-using-the-clang-static-analyzer.html">Mike Ash - Using the Clang Static Analyzer</a></li>
137</ul>
138
139
140</div>
Ted Kremenek8bebc6e2010-02-09 23:05:59 +0000141</div>
Ted Kremenek591b9072009-06-08 21:21:24 +0000142</body>
143</html>
144