[LLVMbugs] [Bug 8124] copy is only important at the start of a method name

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 2 12:06:53 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=8124

Ted Kremenek <kremenek at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #9 from Ted Kremenek <kremenek at apple.com> 2010-12-02 14:06:53 CST ---
(In reply to comment #8)
> (In reply to comment #7)
> > Note, you can use the attribute 'ns_returns_not_retained' to override the
> > behavior.
> 
> This attribute is not present in the headers for any of the methods that
> contain this convention.  There are, in fact, no cases in Apple's Foundation or
> AppKit frameworks where a method contains the word copy anywhere other than at
> the start, yet returns an owned reference (many return BOOL, or some other
> non-object type, some return a non-owned reference).  
> 
> If the conventions are meant to be correct, then I suggest that you remind the
> Cocoa team that they have been consistently violating them for approximately 20
> years (some of the methods of this form are present in the OpenStep
> specification, while some were introduced as recently as OS X 10.6).  
> 
> Surely correcting the conventions to reflect how they have been used - and the
> expectations of developers, formed over many years - is a better solution than
> creating lots of spurious warnings.  It's all very well to say that the
> conventions have been vetted, but they have clearly not been observed.  A
> simple grep of the headers will show that this rule is wrong.

After more conversation, the Cocoa guys now agree with you.  The docs will be
updated, and so will the analyzer.

The new rule is that any method that starts with 'copy' or 'mutableCopy'
follows the copy rule.  Anything else that contains 'copy' will need to use the
ns_returns_retained attribute.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list