Re: Techniques to suppress "unused member variable" Clang warnings?
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