Skip to content

Loading…

Hush method return type warnings when importing SUUpdater.h #229

Merged
merged 1 commit into from

3 participants

@mugginsoft

Just a small semantic issue.

When including SUUpdater.h in projects with a warning level set to -Wextra warnings are generated because - delegate and - initForBundle: have no return type specified.

Clang seems to have a sweet spot with -Wall and -Wextra so it would be nice to be able to include Sparkle in a project without it generating any additional warning noise.

http://programmers.stackexchange.com/questions/122608/clang-warning-flags-for-objective-c-development

@mugginsoft mugginsoft Add explicit method return types in header to supress warnings when i…
…ncluding framework in projects with more exacting warnings such as -Wextra.
69c9c70
@andymatuschak

Oh, man, my 10.1-style syntax is no longer legit, huh? I remember that for a while, I was thinking about Obj-C purely in terms of Smalltalk, so I never wanted to write any types anywhere—I just typed everything id. Back then, I thought that it was really elegant to be able to just leave off the type declaration like that.

Now of course, I want as much static typing as I can possibly get, so it's funny to look back on 15-year-old Andy and see his nonsense.

Thanks for the pull request; I'm sorry it took me so long to get to it.

@andymatuschak andymatuschak merged commit 7fae281 into sparkle-project:master
@quinntaylor

There are similar issues in SUAppcastItem.h, so I filed #272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 27, 2012
  1. @mugginsoft

    Add explicit method return types in header to supress warnings when i…

    mugginsoft committed
    …ncluding framework in projects with more exacting warnings such as -Wextra.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +2 −2 SUUpdater.h
  2. +1 −1 SUUpdater.m
View
4 SUUpdater.h
@@ -27,12 +27,12 @@
+ (SUUpdater *)sharedUpdater;
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
-- initForBundle:(NSBundle *)bundle;
+- (id)initForBundle:(NSBundle *)bundle;
- (NSBundle *)hostBundle;
- (void)setDelegate:(id)delegate;
-- delegate;
+- (id)delegate;
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
- (BOOL)automaticallyChecksForUpdates;
View
2 SUUpdater.m
@@ -551,7 +551,7 @@ - (BOOL)updateInProgress
return driver && ([driver finished] == NO);
}
-- delegate { return delegate; }
+- (id)delegate { return delegate; }
- (NSBundle *)hostBundle { return [host bundle]; }
@end
Something went wrong with that request. Please try again.