• 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: Techniques to suppress "unused member variable" Clang warnings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Techniques to suppress "unused member variable" Clang warnings?


  • Subject: Re: Techniques to suppress "unused member variable" Clang warnings?
  • From: James Bucanek <email@hidden>
  • Date: Mon, 7 Feb 2011 11:19:20 -0700

Jean-Daniel Dupas <mailto:email@hidden> wrote (Friday, February 4, 2011 1:54 AM +0100):

I don't know what the status of this feature in the last Xcode version, but
clang supports the unused attribute on obj-c ivar.

I have something like this to workaround this kind of warning:

#if __has_feature(attribute_objc_ivar_unused)
#define UNUSED_IVAR __attribute__((unused))
#else
#define UNUSED_IVAR
#endif

and then

@interface Foo {
int ivar UNUSED_IVAR;
}

@end

I finally got back to this, and I can confirm that this works perfectly in LLVM compiler 1.6 and LLVM GCC 4.2.


Thanks!



James Bucanek
____________________________________________________________________
Author of Professional Xcode 3                   ISBN: 9780470525227
<http://www.proxcode3.com/>
and Learn Objective-C for Java Developers        ISBN: 9781430223696
<http://objectivec4java.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: Find terms "carry over" between apps
  • Next by Date: Very long "Check Dependencies" phase
  • Previous by thread: Re: Techniques to suppress "unused member variable" Clang warnings?
  • Next by thread: Copying old instead of new Bundle Resources
  • Index(es):
    • Date
    • Thread