From ea4d01ab21b2574edddf6b40da8aea026d296cd2 Mon Sep 17 00:00:00 2001 From: Tanner Bennett <8371943+NSExceptional@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:28:37 -0500 Subject: [PATCH] Silence -Werror unused-function warning for isProtectedDataAvailableAsync The Xcode 26 recommended settings adopted in #355 enable -Wunused-function as an error, breaking the iOS build. isProtectedDataAvailableAsync in TSKSPKIHashCache.m is intentionally kept for an upcoming rewrite, so mark it __attribute__((unused)) rather than removing it. --- TrustKit/Pinning/TSKSPKIHashCache.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TrustKit/Pinning/TSKSPKIHashCache.m b/TrustKit/Pinning/TSKSPKIHashCache.m index a4d121a..4c1abb0 100644 --- a/TrustKit/Pinning/TSKSPKIHashCache.m +++ b/TrustKit/Pinning/TSKSPKIHashCache.m @@ -163,17 +163,19 @@ static BOOL isProtectedDataAvailable(void) } } +// Currently unused, but kept for an upcoming rewrite that will need an async variant. +static void isProtectedDataAvailableAsync(dispatch_queue_t callbackQueue, void (^callback)(BOOL available)) __attribute__((unused)); static void isProtectedDataAvailableAsync(dispatch_queue_t callbackQueue, void (^callback)(BOOL available)) { NSCParameterAssert(callbackQueue); NSCParameterAssert(callback); - + void (^callbackOnQueue)(BOOL) = ^(BOOL available) { dispatch_async(callbackQueue, ^{ callback(available); }); }; - + if (NSThread.isMainThread) { callbackOnQueue(_isProtectedDataAvailable()); } else {