<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello!<div><br></div><div>I have a problem with the Static Analyzer. I have the following class:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span style="color: #aa0d91">@interface</span> MyClass : NSObject {}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">- (CFDateRef) returnsCFRetainedCF <span style="color: #643820">CF_RETURNS_RETAINED</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-style-span" style="color: rgb(170, 13, 145); ">@end</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(170, 13, 145); ">@implementation<span style="color: #000000"> MyClass</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">- (CFDateRef) returnsCFRetainedCF {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">    </span><span style="color: #aa0d91">return</span> CFDateCreate(<span style="color: #1c00cf">0</span>, CFAbsoluteTimeGetCurrent()); <span style="color: #007400">// Potential leak of an object…</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><span class="Apple-style-span" style="color: rgb(170, 13, 145); ">@end</span></div><div><font class="Apple-style-span" color="#AA0D91" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" color="#AA0D91" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; ">When I run the Static Analyzer on this I get an issue "Potential leak of an object allocated on line n". I have tried to remove the issue with the "CF_RETURNS_RETAINED" in the interface declaration (as you can see above) but that does not work. It works fine if I make a cast and return the object as an objC object (NSDate*).</span></span></font></div><div><br></div><div>I'm running XCode 3.2 on Mac OS 10.6 Beta (IDE/Core: 1602.0, ToolSupport: 1591.0). I have a small XCode project if anyone wants to look closer at my problem: <a href="http://oops.se/StaticAnalyzerTest.zip">http://oops.se/StaticAnalyzerTest.zip</a></div><div><br></div><div>Is this how it should work or is this a bug? Any information would be very helpful.</div><div><br></div><div><br></div><div>Thanks and best regards,</div><div><br></div><div>- Martin</div></div></body></html>