1 <!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"> 8 <script type="text/javascript" src="scripts/menu.js"></script> 9 <style type="text/css"> 10 tr:first-child { width:20%; } 11 </style> 12 </head> 13 <body> 14 15 <div id="page"> 16 <!--#include virtual="menu.html.incl"--> 17 18 <div id="content"> 19 20 <h1>Available Checks</h1> 21 22 <h3>The list of the checks the analyzer performs by default</h3> 23 <p> 24 <table border="0" cellpadding="3" cellspacing="3" width="100%"> 25 <!-- <tr> 26 <th><h4>Checker Name</h4></th> 27 <th><h4>Description</h4></th> 28 </tr>--> 29 <tr> 30 <td><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> 31 </tr> 32 <tr> 33 <td><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> 34 </tr> 35 <tr> 36 <td><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> 37 </tr> 38 <tr> 39 <td><b>core.DivideZero</b></td><td>Check for division by zero.</td> 40 </tr> 41 <tr> 42 <td><b>core.NullDereference</b></td><td>Check for dereferences of null pointers.</td> 43 </tr> 44 <tr> 45 <td><b>core.StackAddressEscape</b></td><td>Check that addresses to stack memory do not escape the function.</td> 46 </tr> 47 <tr> 48 <td><b>core.UndefinedBinaryOperatorResult</b></td><td>Check for undefined results of binary operators.</td> 49 </tr> 50 <tr> 51 <td><b>core.VLASize</b></td><td>Check for declarations of VLA of undefined or zero size.</td> 52 </tr> 53 <tr> 54 <td><b>core.builtin.BuiltinFunctions</b></td><td>Evaluate compiler builtin functions (e.g., alloca()).</td> 55 </tr> 56 <tr> 57 <td><b>core.builtin.NoReturnFunctions</b></td><td>Evaluate "panic" functions that are known to not return to the caller.</td> 58 </tr> 59 <tr> 60 <td><b>core.uninitialized.ArraySubscript</b></td><td>Check for uninitialized values used as array subscripts.</td> 61 </tr> 62 <tr> 63 <td><b>core.uninitialized.Assign</b></td><td>Check for assigning uninitialized values.</td> 64 </tr> 65 <tr> 66 <td><b>core.uninitialized.Branch</b></td><td>Check for uninitialized values used as branch conditions.</td> 67 </tr> 68 <tr> 69 <td><b>core.uninitialized.CapturedBlockVariable</b></td><td>Check for blocks that capture uninitialized values.</td> 70 </tr> 71 <tr> 72 <td><b>core.uninitialized.UndefReturn</b></td><td>Check for uninitialized values being returned to the caller.</td> 73 </tr> 74 <tr> 75 <td><b>deadcode.DeadStores</b></td><td>Check for values stored to variables that are never read afterwards.</td> 76 </tr> 77 <tr> 78 <td><b>deadcode.IdempotentOperations</b></td><td>Warn about idempotent operations.</td> 79 </tr> 80 <tr> 81 <td><b>osx.API</b></td><td>Check for proper uses of various Mac OS X APIs.</td> 82 </tr> 83 <tr> 84 <td><b>osx.AtomicCAS</b></td><td>Evaluate calls to OSAtomic functions.</td> 85 </tr> 86 <tr> 87 <td><b>osx.SecKeychainAPI</b></td><td>Check for proper uses of Secure Keychain APIs.</td> 88 </tr> 89 <tr> 90 <td><b>osx.cocoa.AtSync</b></td><td>Check for null pointers used as mutexes for @synchronized.</td> 91 </tr> 92 <tr> 93 <td><b>osx.cocoa.ClassRelease</b></td><td>Check for sending 'retain', 'release', or 'autorelease' directly to a Class.</td> 94 </tr> 95 <tr> 96 <td><b>osx.cocoa.IncompatibleMethodTypes</b></td><td>Warn about Objective-C method signatures with type incompatibilities.</td> 97 </tr> 98 <tr> 99 <td><b>osx.cocoa.NSAutoreleasePool</b></td><td>Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode.</td> 100 </tr> 101 <tr> 102 <td><b>osx.cocoa.NSError</b></td><td>Check usage of NSError** parameters.</td> 103 </tr> 104 <tr> 105 <td><b>osx.cocoa.NilArg</b></td><td>Check for prohibited nil arguments to ObjC method calls.</td> 106 </tr> 107 <tr> 108 <td><b>osx.cocoa.RetainCount</b></td><td>Check for leaks and improper reference count management.</td> 109 </tr> 110 <tr> 111 <td><b>osx.cocoa.UnusedIvars</b></td><td>Warn about private ivars that are never used.</td> 112 </tr> 113 <tr> 114 <td><b>osx.cocoa.VariadicMethodTypes</b></td><td>Check for passing non-Objective-C types to variadic methods that expect only Objective-C types.</td> 115 </tr> 116 <tr> 117 <td><b>osx.coreFoundation.CFError</b></td><td>Check usage of CFErrorRef* parameters.</td> 118 </tr> 119 <tr> 120 <td><b>osx.coreFoundation.CFNumber</b></td><td>Check for proper uses of CFNumberCreate.</td> 121 </tr> 122 <tr> 123 <td><b>osx.coreFoundation.CFRetainRelease</b></td><td>Check for null arguments to CFRetain/CFRelease.</td> 124 </tr> 125 <tr> 126 <td><b>unix.API</b></td><td>Check calls to various UNIX/Posix functions.</td> 127 </tr> 128 </table> 129 130 <p>In addition to these the analyzer contains numerous experimental (beta) checkers.</p> 131 132 <h3>Writeups with examples of some of the bugs that the analyzer finds</h3> 133 134 <ul> 135 <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> 136 <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> 137 <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> 138 <li><a href="http://www.rogueamoeba.com/utm/2008/07/14/the-clang-static-analyzer/">Under the Microscope - The Clang Static Analyzer</a></li> 139 <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> 140 </ul> 141 142 143 </div> 144 </div> 145 </body> 146 </html> 147 148