Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property is assumed atomic by default

I'm trying to get rid of an annoying warning that CLANG/LLVM 3.0 is giving me. I have the following ivar set in my object:

bool preloaded;

And the following property declaration:

@property(readonly) bool preloaded;

And the following synthesize call:

@synthesize preloaded;

As it stands, the compiler complains:

Property is assumed atomic by default

If I change the property declaration to add "atomic":

@property(atomic,readonly) bool preloaded;

It complains about that, too:

error: expected a property attribute before 'atomic'

So it appears I'm damned if I do and damned if I don't... Is there something I'm missing?

like image 496
Karl Avatar asked Nov 27 '11 20:11

Karl


1 Answers

It seems you have the Implicit Atomic Objective-C Properties LLVM compiler warning enabled in your project settings. Turning this off will remove the warning.

As noted above, atomic is not a valid keyword, and is merely implied by the absence of nonatomic. From Apple's Declared Properties documentation:

You can use this attribute to specify that accessor methods are not atomic. (There is no keyword to denote atomic.)

like image 177
jnic Avatar answered Sep 19 '22 19:09

jnic