From 33a2bfe2ea860c1c0cf8f58af8d4be4dd130dce7 Mon Sep 17 00:00:00 2001 From: Adam Sharp Date: Wed, 26 Dec 2018 15:09:13 -0500 Subject: [PATCH] Enable -Wstrict-prototypes --- ReactiveObjC.xcodeproj/project.pbxproj | 16 ++++++++++++++++ ReactiveObjC/NSObject+RACAppKitBindings.m | 2 +- ReactiveObjC/NSObject+RACKVOWrapper.m | 2 +- ReactiveObjC/RACSignal+Operations.m | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index d1a808372..af597fe65 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -2590,6 +2590,7 @@ baseConfigurationReference = 57A4D2461BA13F9700F7D4B1 /* tvOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2609,6 +2610,7 @@ baseConfigurationReference = 57A4D2461BA13F9700F7D4B1 /* tvOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2628,6 +2630,7 @@ baseConfigurationReference = 57A4D2461BA13F9700F7D4B1 /* tvOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2647,6 +2650,7 @@ baseConfigurationReference = 57A4D2461BA13F9700F7D4B1 /* tvOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2736,6 +2740,7 @@ baseConfigurationReference = A97451351B3A935E00F48E55 /* watchOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2755,6 +2760,7 @@ baseConfigurationReference = A97451351B3A935E00F48E55 /* watchOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2774,6 +2780,7 @@ baseConfigurationReference = A97451351B3A935E00F48E55 /* watchOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2793,6 +2800,7 @@ baseConfigurationReference = A97451351B3A935E00F48E55 /* watchOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2857,6 +2865,7 @@ baseConfigurationReference = D047263A19E49FE8006002AA /* Mac-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2873,6 +2882,7 @@ baseConfigurationReference = D047263A19E49FE8006002AA /* Mac-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2923,6 +2933,7 @@ baseConfigurationReference = D047263419E49FE8006002AA /* iOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2939,6 +2950,7 @@ baseConfigurationReference = D047263419E49FE8006002AA /* iOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -3003,6 +3015,7 @@ baseConfigurationReference = D047263A19E49FE8006002AA /* Mac-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -3034,6 +3047,7 @@ baseConfigurationReference = D047263419E49FE8006002AA /* iOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -3083,6 +3097,7 @@ baseConfigurationReference = D047263A19E49FE8006002AA /* Mac-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -3116,6 +3131,7 @@ baseConfigurationReference = D047263419E49FE8006002AA /* iOS-Framework.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; diff --git a/ReactiveObjC/NSObject+RACAppKitBindings.m b/ReactiveObjC/NSObject+RACAppKitBindings.m index 9c00edda0..06fd5d011 100644 --- a/ReactiveObjC/NSObject+RACAppKitBindings.m +++ b/ReactiveObjC/NSObject+RACAppKitBindings.m @@ -93,7 +93,7 @@ - (instancetype)initWithTarget:(id)target bindingName:(NSString *)bindingName op @weakify(self); - void (^cleanUp)() = ^{ + void (^cleanUp)(void) = ^{ @strongify(self); id target = self.target; diff --git a/ReactiveObjC/NSObject+RACKVOWrapper.m b/ReactiveObjC/NSObject+RACKVOWrapper.m index 32e99e266..099dc773a 100644 --- a/ReactiveObjC/NSObject+RACKVOWrapper.m +++ b/ReactiveObjC/NSObject+RACKVOWrapper.m @@ -54,7 +54,7 @@ - (RACDisposable *)rac_observeKeyPath:(NSString *)keyPath options:(NSKeyValueObs BOOL isObject = attributes->objectClass != nil || strstr(attributes->type, @encode(id)) == attributes->type; BOOL isProtocol = attributes->objectClass == NSClassFromString(@"Protocol"); - BOOL isBlock = strcmp(attributes->type, @encode(void(^)())) == 0; + BOOL isBlock = strcmp(attributes->type, @encode(void(^)(void))) == 0; BOOL isWeak = attributes->weak; // If this property isn't actually an object (or is a Class object), diff --git a/ReactiveObjC/RACSignal+Operations.m b/ReactiveObjC/RACSignal+Operations.m index 1ec375ea9..87967adfd 100644 --- a/ReactiveObjC/RACSignal+Operations.m +++ b/ReactiveObjC/RACSignal+Operations.m @@ -328,7 +328,7 @@ - (RACSignal *)bufferWithTime:(NSTimeInterval)interval onScheduler:(RACScheduler RACSerialDisposable *timerDisposable = [[RACSerialDisposable alloc] init]; NSMutableArray *values = [NSMutableArray array]; - void (^flushValues)() = ^{ + void (^flushValues)(void) = ^{ @synchronized (values) { [timerDisposable.disposable dispose];