From a6c215cf2abdf8cc5b141ddb3ff3f5f59ac1b7fd Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 23 Mar 2025 07:26:30 -0700 Subject: [PATCH] Fix compiler warnings for Xcode 16.3 (#2709) Also silence project upgrade warnings. --- Autoupdate/SPUSparkleDeltaArchive.m | 2 +- Autoupdate/SUBinaryDeltaApply.m | 2 +- Autoupdate/SUBinaryDeltaCreate.m | 4 ++-- Autoupdate/SUCodeSigningVerifier.m | 4 ++-- Configurations/ConfigCommon.xcconfig | 2 +- Sparkle.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/BinaryDelta.xcscheme | 2 +- .../xcshareddata/xcschemes/Distribution.xcscheme | 2 +- .../xcshareddata/xcschemes/Sparkle Test App.xcscheme | 2 +- Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme | 2 +- Sparkle.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme | 2 +- .../xcshareddata/xcschemes/generate_appcast.xcscheme | 2 +- .../xcshareddata/xcschemes/generate_keys.xcscheme | 2 +- .../xcshareddata/xcschemes/sign_update.xcscheme | 2 +- .../xcshareddata/xcschemes/sparkle-cli.xcscheme | 2 +- Sparkle/SUAppcastDriver.m | 2 +- Sparkle/SULog.m | 5 +++++ 17 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Autoupdate/SPUSparkleDeltaArchive.m b/Autoupdate/SPUSparkleDeltaArchive.m index 90da3749..289dbf6d 100644 --- a/Autoupdate/SPUSparkleDeltaArchive.m +++ b/Autoupdate/SPUSparkleDeltaArchive.m @@ -1141,7 +1141,7 @@ static compression_algorithm _compressionAlgorithmForMode(SPUDeltaCompressionMod } else if (S_ISLNK(extractMode)) { off_t fileSize = itemFileInfo.st_size; if (fileSize > UINT16_MAX) { - _error = [NSError errorWithDomain:SPARKLE_DELTA_ARCHIVE_ERROR_DOMAIN code:SPARKLE_DELTA_ARCHIVE_ERROR_CODE_LINK_TOO_LONG userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Link path has a destination that is too long: %llu bytes", fileSize] }]; + _error = [NSError errorWithDomain:SPARKLE_DELTA_ARCHIVE_ERROR_DOMAIN code:SPARKLE_DELTA_ARCHIVE_ERROR_CODE_LINK_TOO_LONG userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Link path has a destination that is too long: %lld bytes", fileSize] }]; break; } diff --git a/Autoupdate/SUBinaryDeltaApply.m b/Autoupdate/SUBinaryDeltaApply.m index 6e3df0ce..f8ca965f 100644 --- a/Autoupdate/SUBinaryDeltaApply.m +++ b/Autoupdate/SUBinaryDeltaApply.m @@ -389,7 +389,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa } if (verbose) { - fprintf(stderr, "\n👮 %s %s (0%o)", VERBOSE_MODIFIED, [relativePath fileSystemRepresentation], mode & PERMISSION_FLAGS); + fprintf(stderr, "\n👮 %s %s (0%o)", VERBOSE_MODIFIED, [relativePath fileSystemRepresentation], (unsigned int)(mode & PERMISSION_FLAGS)); } } }]; diff --git a/Autoupdate/SUBinaryDeltaCreate.m b/Autoupdate/SUBinaryDeltaCreate.m index 3fe18345..b04c4f0c 100644 --- a/Autoupdate/SUBinaryDeltaCreate.m +++ b/Autoupdate/SUBinaryDeltaCreate.m @@ -477,7 +477,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF fprintf(stderr, "\n"); } if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }]; + *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", (unsigned int)VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }]; } return NO; } @@ -591,7 +591,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF fprintf(stderr, "\n"); } if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }]; + *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", (unsigned int)VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }]; } return NO; } diff --git a/Autoupdate/SUCodeSigningVerifier.m b/Autoupdate/SUCodeSigningVerifier.m index 45b2b58c..b88c8e2f 100644 --- a/Autoupdate/SUCodeSigningVerifier.m +++ b/Autoupdate/SUCodeSigningVerifier.m @@ -68,7 +68,7 @@ // See https://github.com/sparkle-project/Sparkle/issues/376#issuecomment-48824267 and https://developer.apple.com/library/mac/technotes/tn2206 // Additionally, there are several reasons to stay away from deep verification and to prefer EdDSA signing the download archive instead. // See https://github.com/sparkle-project/Sparkle/pull/523#commitcomment-17549302 and https://github.com/sparkle-project/Sparkle/issues/543 - SecCSFlags flags = (SecCSFlags) (kSecCSDefaultFlags | kSecCSCheckAllArchitectures); + SecCSFlags flags = kSecCSCheckAllArchitectures; result = SecStaticCodeCheckValidityWithErrors(staticCode, flags, requirement, &cfError); if (result != errSecSuccess) { @@ -154,7 +154,7 @@ finally: } // See in -codeSignatureIsValidAtBundleURL:andMatchesSignatureAtBundleURL:error: for why kSecCSCheckNestedCode is not always passed - SecCSFlags flags = (SecCSFlags) (kSecCSDefaultFlags | kSecCSCheckAllArchitectures); + SecCSFlags flags = kSecCSCheckAllArchitectures; if (checkNestedCode) { flags |= kSecCSCheckNestedCode; } diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index e91d8e7c..10a316bf 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -164,4 +164,4 @@ GCC_WARN_UNUSED_PARAMETER = YES GCC_WARN_UNUSED_VARIABLE = YES // Turn on all warnings, then disable a few which are almost impossible to avoid -WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Werror=undef +WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Wno-switch-default -Wno-missing-include-dirs -Werror=undef diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index e4090dd6..87d7e335 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -3016,7 +3016,7 @@ attributes = { CLASSPREFIX = SU; LastSwiftUpdateCheck = 1020; - LastUpgradeCheck = 1400; + LastUpgradeCheck = 1630; ORGANIZATIONNAME = "Sparkle Project"; TargetAttributes = { 5D06E8CF0FD68C7C005AE3F6 = { diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/BinaryDelta.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/BinaryDelta.xcscheme index d33d6de2..9a0f0d1c 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/BinaryDelta.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/BinaryDelta.xcscheme @@ -1,6 +1,6 @@