-
-
Save sergeytimoshin/3990247 to your computer and use it in GitHub Desktop.
Exploring the 'atomic' keyword in properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
// clang -g -Wall -framework Foundation -o atomic atomic.m | |
// gcc -g -Wall -framework Foundation -o atomic atomic.m | |
@interface Blah : NSObject | |
@property (assign, NS_NONATOMIC_IOSONLY) NSInteger frobnozzle; | |
@property (assign, ) NSInteger commaAtEnd; | |
// @property (, assign) NSInteger commaAtBeginning; // Syntax error | |
@property (atomic, assign) NSInteger blah; // complains in gcc | |
@end | |
@implementation Blah | |
#define GET_WARNING 0 | |
#if GET_WARNING | |
- (NSInteger) blah { | |
return _blah; | |
} // blah | |
#endif | |
@end | |
int main (void) { | |
return 0; | |
} // main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment