__attribute__ in Objective-C
__attribute__ in Objective-C
- Subject: __attribute__ in Objective-C
- From: "Alexander v. Below" <email@hidden>
- Date: Fri, 21 Oct 2005 13:45:02 +0200
Hello,
I hope this post is considered on topic, but I guess this list knows
more about this than any gcc list...
How do I use the gcc "__attribute__" (1)correctly in a Objective-C
declaration?
Both:
- (IBAction) test:(id)sender __attribute__ ((unused))
- (IBAction) test:(id) __attribute__ ((unused)) sender
are not parsed successfully. The following is parsed
- (IBAction) test:(id __attribute__ ((unused)))sender
however, gcc still generates a warning "unused parameter: sender"
While Apple gcc provides the old CodeWarrior #pragma unused, I found
that it does not work well with C++ code. Consequently, I wanted to
"migrate" to __attribute__ unused in all subseqent code.
Also, the gcc documentation(2) makes the claim that " It was
basically a mistake to use #pragma for anything."
Any pointers are appreciated.
Thanks
Alex
(1) http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.0/
gcc/Attribute-Syntax.html#Attribute-Syntax
(2) http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.0/
gcc/Variable-Attributes.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden