• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
      • From: Christiaan Hofman <email@hidden>
    • Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
      • From: Chris Suter <email@hidden>
References: 
 >LLVM : spurious memory-mgmt warnings with "Copy" methods (From: Jerry Krinock <email@hidden>)

  • Prev by Date: LLVM : spurious memory-mgmt warnings with "Copy" methods
  • Next by Date: Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
  • Previous by thread: LLVM : spurious memory-mgmt warnings with "Copy" methods
  • Next by thread: Re: LLVM : spurious memory-mgmt warnings with "Copy" methods
  • Index(es):
    • Date
    • Thread