[futurebasic] Re: [FB] Clang Analysis

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2010 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Thu, 29 Apr 2010 13:06:58 +1200
Waverly wrote:

> Does anyone know a way to manage Clang Analysis so that you filter out the message "Potential leak of an object allocated on lineā€¦"
> I have a number of CF objects that I store in static variables and release at a later time.  In one respect, its good keep those messages
> around so that you know there really is a potential.  However, it is also annoying when I know they are being released later in the program.
> http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/220-Analyzing_Code/static_analysis.html#//apple_ref/doc/uid/TP40006917-CH4-SW2

When the clang analyser first became available, it found real leaks in various parts of the FB5 package.
It also gave leak and over-release warnings that on close inspection proved to to be spurious. We were able to suppress the warnings after some head-scratching. It helped to know that clang looks at your function names for elements like "xxxCreateXxx" and xxxCopyXxxx" when it works out the ownership of CoreFoundation objects being passed around. 

Please post a small example that demontrates your unwanted warning.

Robert P.