• 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: #pragma doesn't
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #pragma doesn't


  • Subject: Re: #pragma doesn't
  • From: James Bucanek <email@hidden>
  • Date: Wed, 6 Jan 2010 09:07:27 -0700

Charlie Dickman <mailto:email@hidden> wrote (Wednesday, December 23, 2009 6:21 PM -0500):

According to the documentation #pragma unused (iVar) is supposed to suppress any unused variable warning for iVar but it doesn't. Anybody know what gives?

I write #pragma unused() practically every day and it's never failed to do its job. No one has given any example of where it fails, so I'm still curious about the OP's predicament.


I always place my #pragma statements at the beginning of the method block:

- (void)doSomething:(id)sender
{
#pragma unused(sender)
    ...
}

Works every time.

I've tried __unused and __attribute__... but find them difficult to read and not as obvious. They are also more difficult to put inside #if/#endif blocks in situations where the variable might be used in one case and not used in another.



James Bucanek
____________________________________________________________________
Author of Beginning Xcode                           ISBN: 047175479X
<http://www.beginningxcode.com/>

_______________________________________________
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


  • Prev by Date: Re: Can no longer debug on one device ("The program being debugged is not being run")
  • Next by Date: Re: How to install pkg-config on Mac OS X 10.5 ?
  • Previous by thread: Re: #pragma doesn't
  • Next by thread: Need help with Instruments 2.0.1
  • Index(es):
    • Date
    • Thread