[cfe-commits] r74098 - in /cfe/trunk/www/analyzer: annotations.html images/example_cf_returns_retained.png images/example_cf_returns_retained_gc.png
Ted Kremenek
kremenek at apple.com
Wed Jun 24 12:04:46 PDT 2009
Author: kremenek
Date: Wed Jun 24 14:04:37 2009
New Revision: 74098
URL: http://llvm.org/viewvc/llvm-project?rev=74098&view=rev
Log:
Replace 'clang --analyze' example for attribute cf_returns_retained with screenshots.
Added:
cfe/trunk/www/analyzer/images/example_cf_returns_retained.png (with props)
cfe/trunk/www/analyzer/images/example_cf_returns_retained_gc.png (with props)
Modified:
cfe/trunk/www/analyzer/annotations.html
Modified: cfe/trunk/www/analyzer/annotations.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/annotations.html?rev=74098&r1=74097&r2=74098&view=diff
==============================================================================
--- cfe/trunk/www/analyzer/annotations.html (original)
+++ cfe/trunk/www/analyzer/annotations.html Wed Jun 24 14:04:37 2009
@@ -259,23 +259,21 @@
return (NSDate*) returnsRetainedCFDate(); // Report a leak when using GC.
}
@end
-
-<span class="command">$ clang --analyze test.m</span>
-test.m:28:20: warning: Potential leak of an object allocated on line 28
- return (NSDate*) returnsRetainedCFDate(); // Always report a leak.
- ^
-1 diagnostic generated.
-
-<span class="command">$ clang --analyze test.m <span class="code_highlight">-fobjc-gc-only</span></span>
-test.m:28:20: warning: Potential leak (when using garbage collection) of an object allocated on line 28
- return (NSDate*) returnsRetainedCFDate(); // Always report a leak.
- ^
-test.m:32:20: warning: Potential leak (when using garbage collection) of an object allocated on line 32
- return (NSDate*) returnsRetainedCFDate(); // Report a leak when using GC.
- ^
-2 diagnostics generated.
</pre>
+<p>Running <tt>scan-build</tt> on this example produces the following output:</p>
+
+<img src="images/example_cf_returns_retained.png">
+
+</p>When the above code is compiled using Objective-C garbage collection (i.e.,
+code is compiled with the flag <tt>-fobjc-gc</tt> or <tt>-fobjc-gc-only</tt>),
+<tt>scan-build</tt> produces both the above error (with slightly different text
+to indicate the code uses garbage collection) as well as the following warning,
+which indicates a leak that occurs <em>only</em> when using garbage
+collection:</p>
+
+<img src="images/example_cf_returns_retained_gc.png">
+
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<h2 id="custom_assertions">Custom Assertion Handlers</h2>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Added: cfe/trunk/www/analyzer/images/example_cf_returns_retained.png
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/images/example_cf_returns_retained.png?rev=74098&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cfe/trunk/www/analyzer/images/example_cf_returns_retained.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cfe/trunk/www/analyzer/images/example_cf_returns_retained_gc.png
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/images/example_cf_returns_retained_gc.png?rev=74098&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cfe/trunk/www/analyzer/images/example_cf_returns_retained_gc.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
More information about the cfe-commits
mailing list