1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <title>Implicit 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 <script type=
"text/javascript" src=
"scripts/expandcollapse.js"></script>
10 <style type=
"text/css">
11 tr:first-child
{ width:20%; }
14 <body onload=
"initExpandCollapse()">
17 <!--#include virtual="menu.html.incl"-->
20 <h1>Implicit Checkers
</h1>
21 Even though the implicit checkers do not produce any warnings, they are used to
22 support the analyzer core and model known APIs. See also
23 <a href =
"available_checks.html">Default Checkers
</a>
24 and
<a href =
"alpha_checks.html">Experimental (Alpha) Checkers
</a>.
26 <li><a href=
"#core_implicit_checkers">Core Implicit Checkers
</a></li>
27 <li><a href=
"#osx_implicit_checkers">OS X Implicit Checkers
</a></li>
30 <!-- =========================== core implicit =========================== -->
31 <h3 id=
"core_implicit_checkers">Core Implicit Checkers
</h3>
32 <table class=
"checkers">
33 <colgroup><col class=
"namedescr"><col class=
"example"></colgroup>
34 <thead><tr><td>Name, Description
</td><td>Example
</td></tr></thead>
37 <tr><td><div class=
"namedescr expandable"><span class=
"name">
38 core.DynamicTypePropagation
</span><span class=
"lang">
39 (C++, ObjC)
</span><div class=
"descr">
40 Generate dynamic type information.
</div></div></td>
41 <td><div class=
"exampleContainer expandable">
42 <div class=
"example"><pre>
54 // DynamicTypeInfo for 'this' rigion will wrap type 'A'
55 // unless the base constructor call expression is processed
59 </pre></div><div class=
"separator"></div>
60 <div class=
"example"><pre>
62 @interface MyClass : NSObject {}
65 @implementation MyClass
67 MyClass *x = [[self alloc] init];
68 // DynamicTypeInfo from a cast: from 'id' to 'MyClass *'
73 MyClass *x = [MyClass alloc];
74 // DynamicTypeInfo from a call to alloc:
75 // from 'id' to 'MyClass *'
77 </pre></div></div></td></tr>
80 <tr><td><div class=
"namedescr expandable"><span class=
"name">
81 core.builtin.BuiltinFunctions
</span><span class=
"lang">
82 (C)
</span><div class=
"descr">
83 Evaluate compiler builtin functions (e.g.,
<code>alloca()
</code>)
</div></div></td>
84 <td><div class=
"exampleContainer expandable">
85 <div class=
"example"><pre>
87 int *p = (int *)__builtin_alloca(
8);
88 // evaluates to AllocaRegion
90 if(__builtin_expect(x
> 10,
0)) // evaluates to 'x
> 10'
93 </pre></div></div></td></tr>
96 <tr><td><div class=
"namedescr expandable"><span class=
"name">
97 core.builtin.NoReturnFunctions
</span><span class=
"lang">
98 (C, ObjC)
</span><div class=
"descr">
99 Evaluate
"panic" functions that are known to not return to the caller.
</div></div></td>
100 <td><div class=
"exampleContainer expandable">
101 <div class=
"example"><pre>
104 panic(); // generate sink
106 </pre></div><div class=
"separator"></div>
107 <div class=
"example"><pre>
109 @interface MyObj : NSObject {}
113 @implementation MyObj
115 [[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd
119 description:(@
"some text")];
123 </pre></div></div></td></tr>
127 <!-- =========================== OS X implicit =========================== -->
128 <h3 id=
"osx_implicit_checkers">OS X Implicit Checkers
</h3>
129 <table class=
"checkers">
130 <colgroup><col class=
"namedescr"><col class=
"example"></colgroup>
131 <thead><tr><td>Name, Description
</td><td>Example
</td></tr></thead>
134 <tr><td><div class=
"namedescr expandable"><span class=
"name">
135 osx.cocoa.Loops
</span><span class=
"lang">
136 (ObjC)
</span><div class=
"descr">
137 Improved modeling of loops using Cocoa collection types.
</div></div></td>
138 <td><div class=
"exampleContainer expandable">
139 <div class=
"example"><pre>
142 for (x in [NSArray testObject]) {
143 // assume the value of 'x' is non-nil
146 </pre></div></div></td></tr>
149 <tr><td><div class=
"namedescr expandable"><span class=
"name">
150 osx.cocoa.NonNilReturnValue
</span><span class=
"lang">
151 (ObjC)
</span><div class=
"descr">
152 Model the APIs that are guaranteed to return a non-nil value.
</div></div></td>
153 <td><div class=
"exampleContainer expandable">
154 <div class=
"example"><pre>
155 void test(NSArray *A) {
156 id subscriptObj = A[
1]; // assume the value is non-nil
158 </pre></div></div></td></tr>
163 </div> <!-- content -->