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

"missing-noescape" when building Objective-C library with latest clang #3759

Closed
jyaif opened this issue Oct 16, 2017 · 8 comments
Closed

"missing-noescape" when building Objective-C library with latest clang #3759

jyaif opened this issue Oct 16, 2017 · 8 comments
Assignees

Comments

@jyaif
Copy link

jyaif commented Oct 16, 2017

Clang recently introduced the "missing-noescape" warning. This results in a new warning that prevents from building the Objective-C library:

/third_party/protobuf/objectivec/GPBArray.m:2540:82: error: parameter of overriding method should be annotated with attribute((noescape)) [-Werror,-Wmissing-noescape]

  • (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block {
@thomasvl
Copy link
Contributor

Just confirming, which Xcode are you using? 9.0 or a prerelease? Are you building from cocoapods or manually adding sources and enabling this warning?

@jyaif
Copy link
Author

jyaif commented Oct 18, 2017

Hi,
The context is Chrome for iOS, which you might be familiar with :-)
Here's what we are doing special:
-We are manually adding the sources
-We are building with all warnings treated as errors
-We are using ToT clang ( which is newer than the clang that ships in Xcode 9.1 beta 2 ).

@sergiocampama
Copy link
Contributor

Since this isn't in current release (9.0.1) or the latest beta (9.1b2), we will hold off on making changes.

Could you add the -Wnomissing-noescape flag in the mean time?

@jyaif
Copy link
Author

jyaif commented Oct 23, 2017

Yes, that was the elected workaround.

@sergiocampama
Copy link
Contributor

As of Xcode 9.2, clang does not understand this flag.

@jyaif
Copy link
Author

jyaif commented Dec 11, 2017

Thanks for the update!

@thomasvl
Copy link
Contributor

@sergiocampama do you want to double check this again with Xcode 9.4.x and 10? Assuming it is supported now, we might need some preprocessor shims to ensure we still build with older Xcodes.

@thomasvl
Copy link
Contributor

thomasvl commented Dec 4, 2018

#4729 added the missing annotation for this, and opening the Xcode project in Xcode 10.1 shows the warning defaults to on, so we should be covered going forward if any other block api is added to the library.

@thomasvl thomasvl closed this as completed Dec 4, 2018
RedTahr added a commit to RedTahr/ios that referenced this issue Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants