diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index fb608346..ab4063f8 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -76,4 +76,4 @@ GCC_WARN_UNUSED_VARIABLE = YES WARNING_CFLAGS_EXTRA = -Wno-custom-atomic-properties -Wno-implicit-atomic-properties // Turn on all warnings, then disable a few which are almost impossible to avoid -WARNING_CFLAGS = -Wall -Weverything -Wno-empty-translation-unit -Wno-unused-macros -Wno-gnu-statement-expression -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wno-auto-import -Wno-cstring-format-directive $(WARNING_CFLAGS_EXTRA) +WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wno-auto-import $(WARNING_CFLAGS_EXTRA) diff --git a/Sparkle/SUBinaryDeltaCommon.h b/Sparkle/SUBinaryDeltaCommon.h index 5c226563..3e7db6c6 100644 --- a/Sparkle/SUBinaryDeltaCommon.h +++ b/Sparkle/SUBinaryDeltaCommon.h @@ -65,7 +65,7 @@ typedef NS_ENUM(uint16_t, SUBinaryDeltaMinorVersion) }; #define FIRST_DELTA_DIFF_MAJOR_VERSION SUAzureMajorVersion -#define FIRST_DELTA_DIFF_MINOR_VERSION 0 +#define FIRST_DELTA_DIFF_MINOR_VERSION ((SUBinaryDeltaMinorVersion)0) #define LATEST_DELTA_DIFF_MAJOR_VERSION SUBeigeMajorVersion diff --git a/Sparkle/SUBinaryDeltaCommon.m b/Sparkle/SUBinaryDeltaCommon.m index ec7fc4e1..0df5bfd9 100644 --- a/Sparkle/SUBinaryDeltaCommon.m +++ b/Sparkle/SUBinaryDeltaCommon.m @@ -43,7 +43,7 @@ SUBinaryDeltaMinorVersion latestMinorVersionForMajorVersion(SUBinaryDeltaMajorVe case SUBeigeMajorVersion: return SUBeigeMinorVersion; } - return 0; + return (SUBinaryDeltaMinorVersion)0; } NSString *temporaryFilename(NSString *base) diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index fc5724bd..e42a489c 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -38,7 +38,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza + (AuthorizationRef)authorizationForExecutable:(NSString*)executablePath { - NSParameterAssert(executablePath); + SUParameterAssert(executablePath); // Get authorization using advice in Apple's Technical Q&A1172 @@ -93,7 +93,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza + (void)performInstallationToPath:(NSString *)destinationPath fromPath:(NSString *)packagePath host:(SUHost *)__unused host versionComparator:(id)__unused comparator completionHandler:(void (^)(NSError *))completionHandler { - NSParameterAssert(packagePath); + SUParameterAssert(packagePath); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index 69b698e2..8573602e 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -41,7 +41,7 @@ typedef struct { { if ((self = [super init])) { - NSParameterAssert(aBundle); + SUParameterAssert(aBundle); self.bundle = aBundle; if (![self.bundle bundleIdentifier]) { SULog(@"Error: the bundle being updated at %@ has no %@! This will cause preference read/write to not work properly.", self.bundle, kCFBundleIdentifierKey); diff --git a/Sparkle/SUInstaller.m b/Sparkle/SUInstaller.m index 83b8d610..7648fdb0 100644 --- a/Sparkle/SUInstaller.m +++ b/Sparkle/SUInstaller.m @@ -44,8 +44,8 @@ static NSString *sUpdateFolder = nil; + (NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr { - NSParameterAssert(inUpdateFolder); - NSParameterAssert(host); + SUParameterAssert(inUpdateFolder); + SUParameterAssert(host); // Search subdirectories for the application NSString *currentFile, diff --git a/Sparkle/SUPlainInstaller.m b/Sparkle/SUPlainInstaller.m index 0846f8fd..cea72914 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Sparkle/SUPlainInstaller.m @@ -16,7 +16,7 @@ + (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host versionComparator:(id)comparator completionHandler:(void (^)(NSError *))completionHandler { - NSParameterAssert(host); + SUParameterAssert(host); // Prevent malicious downgrades if (![[[NSBundle bundleWithIdentifier:SUBundleIdentifier] infoDictionary][SUEnableAutomatedDowngradesKey] boolValue]) { diff --git a/Sparkle/SUPlainInstallerInternals.m b/Sparkle/SUPlainInstallerInternals.m index 1edd33a6..f41a72ed 100644 --- a/Sparkle/SUPlainInstallerInternals.m +++ b/Sparkle/SUPlainInstallerInternals.m @@ -231,7 +231,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza const char *coParams[] = { "-R", uidgid, srcPath, NULL }; res = AuthorizationExecuteWithPrivilegesAndWait(auth, "/usr/sbin/chown", kAuthorizationFlagDefaults, coParams); if (!res) - SULog(@"chown -R %s %s failed.", uidgid, srcPath); + SULog(@"chown -R %@ %@ failed.", @(uidgid), @(srcPath)); } BOOL haveDst = [[NSFileManager defaultManager] fileExistsAtPath:dst]; diff --git a/Sparkle/Sparkle.pch b/Sparkle/Sparkle.pch index afac8dca..7a53b80a 100644 --- a/Sparkle/Sparkle.pch +++ b/Sparkle/Sparkle.pch @@ -19,4 +19,9 @@ #define SULocalizedString(key, comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", (NSBundle *__nonnull)([NSBundle bundleWithIdentifier:SUBundleIdentifier] ? [NSBundle bundleWithIdentifier:SUBundleIdentifier] : [NSBundle mainBundle]), comment) +// Work around a warning generated by some versions of Xcode that we still support, +// when using NSParameterAssert +#define SUParameterAssert(condition) \ + NSAssert((condition), @"Invalid parameter not satisfying: %@", @(#condition)) + #endif