Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
- Subject: Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
- From: Jens Alfke <email@hidden>
- Date: Tue, 13 Dec 2011 22:42:05 -0800
On Dec 13, 2011, at 10:33 PM, Jerry Krinock wrote: I think that Warning #1 is spurious because I'm releasing an object which was obtained from a 'Copy' method, which is correct. And Warning #2 is spurious because the method has 'Copy' in its name, therefore returning a retained object is expected.
I think the rules are about methods whose names *begin* with “copy” or “mutableCopy”. So the static analyzer doesn’t recognize your methods as being copiers.
What is the correct way to fix these warnings?
Rename your methods to use the standard naming conventions, I think. Although I vaguely remember reading about some way to flag a method declaration to tell the compiler that it’s a copier (maybe a special __attribute type?)
—Jens
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden