Closed Bug 1564298 Opened 5 years ago Closed 5 years ago

warning: conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:' with OS X 10.14 SDK

Categories

(Core :: Widget: Cocoa, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- wontfix
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- fixed

People

(Reporter: mccr8, Assigned: spohl)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

I think this is another new warning from bug 1560044 (showing up as an error in my build):

0:13.29 In file included from /Users/amccreight/mc/obj-dbg.noindex/toolkit/xre/Unified_mm_toolkit_xre0.mm:2:
0:13.29 /Users/amccreight/mc/toolkit/xre/MacApplicationDelegate.mm:348:46: error: conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:': 'void (^ _Nonnull)(NSArray<id<NSUserActivityRestoring>> * _Nonnull)' vs 'void (^ _Nonnull)(NSArray )' [-Werror,-Wmismatched-parameter-types]
0:13.29 restorationHandler:(void (^)(NSArray
))restorationHandler {
0:13.29 ~~~~~~~~~~~~~~~~~~ ^
0:13.29 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:405:187: note: previous definition is here
0:13.29 - (BOOL)application:(NSApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<NSUserActivityRestoring>> *restorableObjects))restorationHandler NS_AVAILABLE_MAC(10_10);
0:13.29 ~~~~~~ ^
0:13.29 1 error generated.

I confirmed that this happens with the changeset bug 1560044 landed in, but I haven't confirmed this is actually the regressor. But it seems plausible.

(As with the other bug, this is with OS X 10.13.6.)

The real regressor is likely bug 1085391, and the problem is --enable-warnings-as-errors combined with 10.14 SDK. The OS you build this on is not involved.

Regressed by: 1085391
No longer regressed by: 1560044
Summary: warning: conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:' → warning: conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:' with OS X 10.14 SDK
Blocks: buildwarning

The following fixes it:

--- a/toolkit/xre/MacApplicationDelegate.mm
+++ b/toolkit/xre/MacApplicationDelegate.mm
@@ -340,17 +340,17 @@ void ProcessPendingGetURLAppleEvents() {
 
 - (BOOL)application:(NSApplication*)application
     willContinueUserActivityWithType:(NSString*)userActivityType {
   return [userActivityType isEqualToString:NSUserActivityTypeBrowsingWeb];
 }
 
 - (BOOL)application:(NSApplication*)application
     continueUserActivity:(NSUserActivity*)userActivity
-      restorationHandler:(void (^)(NSArray*))restorationHandler {
+      restorationHandler:(void (^)(NSArray<id<NSUserActivityRestoring>>*))restorationHandler {
   if (![userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
     return NO;
   }
 
   return [self openURL:userActivity.webpageURL];
 }
 
 - (void)application:(NSApplication*)application

... but breaks building with older SDKs.

I'm working on a fix along these lines that will still allow for building with older SDKs, but have been slowed down by various build issues on 10.15. Should have a patch shortly.

Pushed by spohl@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2090e35993e0 Make it possible to build with macOS 10.14 SDK. r=mstange
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → spohl.mozilla.bugs

I'm thinking this is probably something we'll want to backport to make developers' lives easier?

Flags: needinfo?(spohl.mozilla.bugs)
Flags: needinfo?(spohl.mozilla.bugs)
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: