forcedotcom / DeskApiClient-ObjC

BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

Fix conflicting parameter types in definition warnings #11

Open evandcoleman opened 8 years ago

evandcoleman commented 8 years ago

At Timehop we build our app with the -Weverything flag and the DeskApiClient produces a lot of warnings that we don't feel comfortable suppressing. We've created our own fork of this repo and have manually disabled this warning using #pragma clang diagnostic ignored in each offending file. But an ideal solution would be to fix the warnings.

To reproduce the problem you can add -Woverriding-method-mismatch to Other Warning Flags in the Xcode build settings.

nartiles commented 8 years ago

We created an internal work item to address this in the future. We'll definitely take a look at cleaning up these warnings. Thanks!

mergesort commented 8 years ago

@nartiles Just wondering if there's been any progress on this. Thanks a lot!

nartiles commented 8 years ago

@mergesort We took a look at the warnings and they are not valid. We set the appropriate class at runtime of these DSAPIResource subclasses to match what's in the method names so these are fake warning. See

DSAPIResource.m, - (instancetype)initWithDictionary:(NSDictionary *)dictionary client:(DSAPIClient *)client
...
// Set the class of the object to the class returned by the web service for self
   object_setClass(self, [self.client classForClassName:_dictionary[kLinksKey][kSelfKey][kClassKey]]);

It is safe to suppress them. We have no plans to add #pragma statements at this time to suppress this.

Instead of forking your own code to suppress these, we recommend you simply use Inhibit all warnings on the DeskAPIClient framework or pod.