Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCode 4.6.3 compile fail #6

Open
sharrismobiquity opened this issue Oct 10, 2013 · 19 comments
Open

XCode 4.6.3 compile fail #6

sharrismobiquity opened this issue Oct 10, 2013 · 19 comments

Comments

@sharrismobiquity
Copy link

When I include MSWeakTimer.m in my iPhone XCode project, I get the following errors at line 169 of MSWeakTimer.m ( __weak typeof(self) weakSelf = self; ) - A parameter list without types is only allowed in a function definition. A corresponding warning tells me that __weak only applies to Objective-C object or block pointer types; type here is 'int'. Any idea why I get these warnings/errors, and what I should do about them?

Thanks!

Steve Harris ([email protected])

@JaviSoto
Copy link
Contributor

That doesn't make sense :-/ self is a pointer to MSWeakTimer. Do you get any other errors? Did you import the .h file too?

@sharrismobiquity
Copy link
Author

Yes I imported the .h file as well... and these are the only errors I get in the whole (massive) project unfortunately...

@JaviSoto
Copy link
Contributor

Can you post a screenshot of Xcode showing the error?

@sharrismobiquity
Copy link
Author

errorscreenshot

@sharrismobiquity
Copy link
Author

I just posed an image showing the compile fail and warnings that I'm getting... thanks for your quick response!

@JaviSoto
Copy link
Contributor

Did you modify the file in any way? Is your project / are you compiling that file with ARC?

@sharrismobiquity
Copy link
Author

Hi! No I didn't modify it in any way - I recopied it into the project just to make sure of that. And as for ARC, I'm pretty sure we do that. I certainly didn't add any specific non-ARC flags for this file. What project settings do you think might be relevant? We are highly customized in our project settings...

@sharrismobiquity
Copy link
Author

Do you want to see the Apple LLVM compiler 4.2 code generation and/or language options, etc?

@sharrismobiquity
Copy link
Author

BTW I can build the included sample project just fine btw... which argues for some odd or unusual local compiler settings or somesuch...

@JaviSoto
Copy link
Contributor

Yeah that makes sense, I'm going to try to figure out what it is. Just for the sake of testing, can you try changing:

__weak typeof(self) weakSelf = self;

to

__weak MSWeakTimer *weakSelf = self;

And tell me what the result is?

@JaviSoto
Copy link
Contributor

Also, on the error list, there's one red circle that has a smaller white circle inside. This is the "fix-it" feature on Xcode. Can you click on it and tell me what the code looks like after the recommended fix?

@sharrismobiquity
Copy link
Author

wooh - we liked that! That seems to compile fine... that is equivalent code, no? And would you think I'd be ok to use that change?

@JaviSoto
Copy link
Contributor

Yeah, that would be equivalent, and I wouldn't mind changing my code to that tbh (typeof() is a little overused in these expressions anyway). I would like to get to the bottom of this if we can though.

@sharrismobiquity
Copy link
Author

hmmm I will poke around and see if there is something that I can narrow it down to. But nothing obvious in build settings thus far...

@sharrismobiquity
Copy link
Author

thanks again for your time and awesome responsiveness!

@JaviSoto
Copy link
Contributor

Sure :) Thanks for using my little project :)

Did you try what I said above?

Also, on the error list, there's one red circle that has a smaller white circle inside. This is the "fix-it" feature on Xcode. Can you click on it and tell me what the code looks like after the recommended fix?

@sharrismobiquity
Copy link
Author

Fixing it was to insert a ; but that was obviously wrong. I did try it however. ;)

@JaviSoto JaviSoto reopened this Oct 10, 2013
@JaviSoto
Copy link
Contributor

Pushed 4007ceb, let me know if that fixes it :)

@JaviSoto
Copy link
Contributor

Pull again from master, I re-tagged 1.1.0 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants