Warning: No 'assign', 'retain' or 'copy' attribute is specified

1,619 views
Skip to first unread message

James Richards

unread,
Oct 14, 2010, 4:30:25 PM10/14/10
to Three20
When compiling a project using three20, I'm getting these two warnings
many times over:

- "No 'assign', 'retain' or 'copy' attribute is specified - 'assign'
is assumed"
- "Default property attribute 'assign' not appropriate for non-gc
object".

When doing a clean build, I get several hundred of these warnings!

They seem to be caused by properties with Class as the type. For
example, the targetClass property from TTURLGeneratorPattern:

@property (nonatomic) Class targetClass;

Are other people seeing these warnings? Is this something I need to
worry about?

My app runs fine but I am getting ready to submit to the App Store and
wan't to make sure these warnings won't be a problem.

Some info that might help:
I'm currently using XCode 3.2.4
Three20 code was downloaded from github on 08/03/2010 (I'm about to
refresh it to see if that makes a difference)
I noticed that this started happening when I upgraded to XCode 3.2.3
and started targeting iOS versions 3.1.3 - 4.x
Base SDK is set to iOS 4.1 for my project and all three20 projects
Deployment Target is set to 3.1.3 for my project and all three20
projects

Thanks in advance for any help!

Jeff Verkoeyen

unread,
Oct 14, 2010, 5:01:23 PM10/14/10
to thr...@googlegroups.com
Aye, 3.2.3 is the one version of Xcode I don't have on my system to test with between 3.2.2 and 3.2.5. That being said, I suggest upgrading Xcode to 3.2.4 if this is an option. I can't reproduce these warnings, so I have to assume for now that it's an Xcode 3.2.3-specific issue.

Cheers,
- Jeff

--
You received this message because you are subscribed to the Google
Groups "Three20" group.
To post to this group, send email to thr...@googlegroups.com
To unsubscribe from this group, send email to
three20+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/three20?hl=en

To learn more about Three20, check out
http://new.Three20.info/

Michael Grinich

unread,
Oct 14, 2010, 5:15:23 PM10/14/10
to thr...@googlegroups.com
Are you compiling with GCC or LLVM/Clang?

James Richards

unread,
Oct 14, 2010, 5:32:51 PM10/14/10
to Three20
@Jeff, Thanks for your reply. I am using 3.2.4.

On Oct 14, 2:01 pm, Jeff Verkoeyen <jverk...@gmail.com> wrote:
> Aye, 3.2.3 is the one version of Xcode I don't have on my system to test
> with between 3.2.2 and 3.2.5. That being said, I suggest upgrading Xcode to
> 3.2.4 if this is an option. I can't reproduce these warnings, so I have to
> assume for now that it's an Xcode 3.2.3-specific issue.
>
> Cheers,
> - Jeff
>
> On Thu, Oct 14, 2010 at 4:30 PM, James Richards
> <richards.jam...@gmail.com>wrote:
> > three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >

James Richards

unread,
Oct 14, 2010, 5:36:00 PM10/14/10
to Three20
@Michael, I am compiling with "LLVM compiler 1.5 — Clang front-end
with LLVM code generator". To be honest, I don't know much about the
differences between the compiler options. I'm using it because my
project includes some other open source code that came with
instructions to use the LLVM compiler.

On Oct 14, 2:15 pm, Michael Grinich <mgrin...@gmail.com> wrote:
> Are you compiling with GCC or LLVM/Clang?
>
>
>
> On Thu, Oct 14, 2010 at 5:01 PM, Jeff Verkoeyen <jverk...@gmail.com> wrote:
> > Aye, 3.2.3 is the one version of Xcode I don't have on my system to test
> > with between 3.2.2 and 3.2.5. That being said, I suggest upgrading Xcode to
> > 3.2.4 if this is an option. I can't reproduce these warnings, so I have to
> > assume for now that it's an Xcode 3.2.3-specific issue.
> > Cheers,
> > - Jeff
>
> > On Thu, Oct 14, 2010 at 4:30 PM, James Richards <richards.jam...@gmail.com>

James Richards

unread,
Oct 14, 2010, 5:43:43 PM10/14/10
to Three20
@Michael, I think you're onto something. I cleaned and built another
project that also includes three20 but uses the "GCC 4.2" compiler and
there are none of these warnings. My question still stands, though: Is
this something I need to worry about for App submission? I've heard
Apple uses some static analysis tools on the binary but I don't know
if this could be a problem. Thanks again!

Jeff Verkoeyen

unread,
Oct 14, 2010, 5:57:39 PM10/14/10
to thr...@googlegroups.com
My mistake; I misread the last part of your email it seems ("when I upgraded to XCode 3.2.3" was the last thing that stood out in my mind as I was writing my response).

It looks as though there are problems building Three20 with the LLVM compiler 1.5 in Xcode 3.2.4. The issue is discussed in more detail here:


The solution appears to be to set __IPHONE_OS_VERSION_MIN_REQUIRED in a prefix header for the project.

The latest mainline Three20 uses this fix to solve a similar issue with the analyzer. You can find the prefix header here:


Currently this prefix header is only being applied to the "Internal" builds. I'll put together a patch that will apply this fix to all of the libraries. This will make it possible to build Three20 with LLVM compiler 1.5.

Cheers,
- Jeff

James Richards

unread,
Oct 14, 2010, 6:29:51 PM10/14/10
to Three20
Thanks for your reply Jeff.

I had seen that Stack Overflow thread and had already set the
__IPHONE_OS_VERSION_MIN_REQUIRED flag in "Other C Flags" for my
project's Build properties. It solved a different issue I was having
running the project in the Simulator.

But even with that flag I am still seeing all the "No 'assign',
'retain' or 'copy'..." warnings.

Note that I'm seeing these warnings when compiling for both the
Simulator and the Device, whereas the Stack Overflow thread was
talking about the problem only occurring when compiling for the
Simulator.

Any other thoughts?

Thanks again for you help. Much appreciated!

- James


On Oct 14, 2:57 pm, Jeff Verkoeyen <jverk...@gmail.com> wrote:
> My mistake; I misread the last part of your email it seems ("when I upgraded
> to XCode 3.2.3" was the last thing that stood out in my mind as I was
> writing my response).
>
> It looks as though there are problems building Three20 with the LLVM
> compiler 1.5 in Xcode 3.2.4. The issue is discussed in more detail here:
>
> http://stackoverflow.com/questions/3677879/strange-issue-after-upgrad...
>
> The solution appears to be to set __IPHONE_OS_VERSION_MIN_REQUIRED in a
> prefix header for the project.
>
> The latest mainline Three20 uses this fix to solve a similar issue with the
> analyzer. You can find the prefix header here:
>
> http://github.com/facebook/three20/blob/master/src/Analyzer/Xcode324S...
>
> Currently this prefix header is only being applied to the "Internal" builds.
> I'll put together a patch that will apply this fix to all of the libraries.
> This will make it possible to build Three20 with LLVM compiler 1.5.
>
> Cheers,
> - Jeff
>
> On Thu, Oct 14, 2010 at 5:43 PM, James Richards
> <richards.jam...@gmail.com>wrote:
> > > > >> three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >
> > > > >> For more options, visit this group at
> > > > >>http://groups.google.com/group/three20?hl=en
>
> > > > >> To learn more about Three20, check out
> > > > >>http://new.Three20.info/
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Three20" group.
> > > > > To post to this group, send email to thr...@googlegroups.com
> > > > > To unsubscribe from this group, send email to
> > > > > three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/three20?hl=en
>
> > > > > To learn more about Three20, check out
> > > > >http://new.Three20.info/
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Three20" group.
> > To post to this group, send email to thr...@googlegroups.com
> > To unsubscribe from this group, send email to
> > three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >

Jeff Verkoeyen

unread,
Oct 14, 2010, 6:29:35 PM10/14/10
to thr...@googlegroups.com
Hah, and it looks like this still didn't directly address the original issue that was brought up. Playing whack-a-mole tonight.

The patch that I'm going to commit soon will make it possible to set:

GCC_VERSION = com.apple.compilers.llvm.clang.1_0

in the common Library.xcconfig file, making all of the Three20 libs build with LLVM 1.5 such that there aren't any build errors.

The next patch shortly after will resolve the warnings originally mentioned.

Thanks for pointing out that the issue was likely with the compiler Michael.

James Richards

unread,
Oct 14, 2010, 6:35:43 PM10/14/10
to Three20
Great! Thank you both for your help.

I'll grab a fresh copy of three20 after you submit the patch(es). If
you think of it and can post a quick note to this thread after you
submit them, that would be helpful.

Cheers,
- James


On Oct 14, 3:29 pm, Jeff Verkoeyen <jverk...@gmail.com> wrote:
> Hah, and it looks like this still didn't directly address the original issue
> that was brought up. Playing whack-a-mole tonight.
>
> The patch that I'm going to commit soon will make it possible to set:
>
> GCC_VERSION = com.apple.compilers.llvm.clang.1_0
>
> in the common Library.xcconfig file, making all of the Three20 libs build
> with LLVM 1.5 such that there aren't any build errors.
>
> The next patch shortly after will resolve the warnings originally mentioned.
>
> Thanks for pointing out that the issue was likely with the compiler Michael.
>
>
>
> On Thu, Oct 14, 2010 at 5:57 PM, Jeff Verkoeyen <jverk...@gmail.com> wrote:
> > My mistake; I misread the last part of your email it seems ("when I
> > upgraded to XCode 3.2.3" was the last thing that stood out in my mind as I
> > was writing my response).
>
> > It looks as though there are problems building Three20 with the LLVM
> > compiler 1.5 in Xcode 3.2.4. The issue is discussed in more detail here:
>
> >http://stackoverflow.com/questions/3677879/strange-issue-after-upgrad...
>
> > The solution appears to be to set __IPHONE_OS_VERSION_MIN_REQUIRED in a
> > prefix header for the project.
>
> > The latest mainline Three20 uses this fix to solve a similar issue with the
> > analyzer. You can find the prefix header here:
>
> >http://github.com/facebook/three20/blob/master/src/Analyzer/Xcode324S...
>
> > Currently this prefix header is only being applied to the "Internal"
> > builds. I'll put together a patch that will apply this fix to all of the
> > libraries. This will make it possible to build Three20 with LLVM compiler
> > 1.5.
>
> > Cheers,
> > - Jeff
>
> > On Thu, Oct 14, 2010 at 5:43 PM, James Richards <richards.jam...@gmail.com
> >> > > >> three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >
> >> > > >> For more options, visit this group at
> >> > > >>http://groups.google.com/group/three20?hl=en
>
> >> > > >> To learn more about Three20, check out
> >> > > >>http://new.Three20.info/
>
> >> > > > --
> >> > > > You received this message because you are subscribed to the Google
> >> > > > Groups "Three20" group.
> >> > > > To post to this group, send email to thr...@googlegroups.com
> >> > > > To unsubscribe from this group, send email to
> >> > > > three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >
> >> > > > For more options, visit this group at
> >> > > >http://groups.google.com/group/three20?hl=en
>
> >> > > > To learn more about Three20, check out
> >> > > >http://new.Three20.info/
>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Three20" group.
> >> To post to this group, send email to thr...@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >

Jeff Verkoeyen

unread,
Oct 14, 2010, 7:04:09 PM10/14/10
to thr...@googlegroups.com
Resolve an issue with Xcode 3.2.4 and building Three20 with LLVM 1.5. 
http://github.com/facebook/three20/commit/fe58271145646e8e88d89d45501e79ef0f27e798

Resolve LLVM 1.5-specific warnings.

Props to: James Richards for highlighting the issue.
Props to: Michael Grinich for pointing out the compiler's role in all of this.

Cheers,
- Jeff

James Richards

unread,
Oct 15, 2010, 7:45:28 PM10/15/10
to Three20
I refreshed my copy of three20 today and can confirm that Jeff's fixes
did the trick. My project is now compiling under LLVM with no
warnings.

Props to: Jeff for fixing the issue superfast

Thanks!
James

On Oct 14, 4:04 pm, Jeff Verkoeyen <jverk...@gmail.com> wrote:
> Resolve an issue with Xcode 3.2.4 and building Three20 with LLVM 1.5.http://github.com/facebook/three20/commit/fe58271145646e8e88d89d45501...
>
> Resolve LLVM 1.5-specific warnings.http://github.com/facebook/three20/commit/fbb1edac676fe34bcd4308e944e...
>
> Props to: James Richards for highlighting the issue.
> Props to: Michael Grinich for pointing out the compiler's role in all of
> this.
>
> Cheers,
> - Jeff
>
> On Thu, Oct 14, 2010 at 6:35 PM, James Richards
> <richards.jam...@gmail.com>wrote:
> > <three20%2Bunsu...@googlegroups.com<three20%252Bunsubscribe@googlegroup s.com>>
> > > >> > > >> For more options, visit this group at
> > > >> > > >>http://groups.google.com/group/three20?hl=en
>
> > > >> > > >> To learn more about Three20, check out
> > > >> > > >>http://new.Three20.info/
>
> > > >> > > > --
> > > >> > > > You received this message because you are subscribed to the
> > Google
> > > >> > > > Groups "Three20" group.
> > > >> > > > To post to this group, send email to thr...@googlegroups.com
> > > >> > > > To unsubscribe from this group, send email to
> > > >> > > > three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >
> > <three20%2Bunsu...@googlegroups.com<three20%252Bunsubscribe@googlegroup s.com>>
> > > >> > > > For more options, visit this group at
> > > >> > > >http://groups.google.com/group/three20?hl=en
>
> > > >> > > > To learn more about Three20, check out
> > > >> > > >http://new.Three20.info/
>
> > > >> --
> > > >> You received this message because you are subscribed to the Google
> > > >> Groups "Three20" group.
> > > >> To post to this group, send email to thr...@googlegroups.com
> > > >> To unsubscribe from this group, send email to
> > > >> three20+u...@googlegroups.com<three20%2Bunsu...@googlegroups.com >
> > <three20%2Bunsu...@googlegroups.com<three20%252Bunsubscribe@googlegroup s.com>>
Reply all
Reply to author
Forward
0 new messages