Merge pull request #13099 from muxi/fix-objc-void-func

Fix warning "declaration is not a prototype"
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h
index 7e87217..bae07ac 100644
--- a/include/grpc/grpc_security.h
+++ b/include/grpc/grpc_security.h
@@ -185,7 +185,7 @@
 GRPCAPI grpc_call_credentials* grpc_google_compute_engine_credentials_create(
     void* reserved);
 
-GRPCAPI gpr_timespec grpc_max_auth_token_lifetime();
+GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void);
 
 /** Creates a JWT credentials object. May return NULL if the input is invalid.
    - json_key is the JSON key string containing the client's private key.
diff --git a/include/grpc/support/alloc.h b/include/grpc/support/alloc.h
index 31cb225..c559198 100644
--- a/include/grpc/support/alloc.h
+++ b/include/grpc/support/alloc.h
@@ -58,7 +58,7 @@
 GPRAPI void gpr_set_allocation_functions(gpr_allocation_functions functions);
 
 /** Return the family of allocation functions currently in effect. */
-GPRAPI gpr_allocation_functions gpr_get_allocation_functions();
+GPRAPI gpr_allocation_functions gpr_get_allocation_functions(void);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h
index 497cca9..9cce4b1 100644
--- a/include/grpc/support/log.h
+++ b/include/grpc/support/log.h
@@ -68,7 +68,7 @@
 /** Set global log verbosity */
 GPRAPI void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print);
 
-GPRAPI void gpr_log_verbosity_init();
+GPRAPI void gpr_log_verbosity_init(void);
 
 /** Log overrides: applications can use this API to intercept logging calls
    and use their own implementations */
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index b5ab611..ac4596d 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -299,7 +299,7 @@
 // network queue if the write didn't succeed.
 // If the call is a unary call, parameter \a errorHandler will be ignored and
 // the error handler of GRPCOpSendClose will be executed in case of error.
-- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)())errorHandler {
+- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)(void))errorHandler {
 
   __weak GRPCCall *weakSelf = self;
   void(^resumingHandler)(void) = ^{
@@ -345,7 +345,7 @@
 
 // Only called from the call queue. The error handler will be called from the
 // network queue if the requests stream couldn't be closed successfully.
-- (void)finishRequestWithErrorHandler:(void (^)())errorHandler {
+- (void)finishRequestWithErrorHandler:(void (^)(void))errorHandler {
   if (!_unaryCall) {
     [_wrappedCall startBatchWithOperations:@[[[GRPCOpSendClose alloc] init]]
                               errorHandler:errorHandler];
@@ -441,7 +441,7 @@
   }
   _connectivityMonitor = [GRPCConnectivityMonitor monitorWithHost:host];
   __weak typeof(self) weakSelf = self;
-  void (^handler)() = ^{
+  void (^handler)(void) = ^{
     typeof(self) strongSelf = weakSelf;
     [strongSelf finishWithError:[NSError errorWithDomain:kGRPCErrorDomain
                                                     code:GRPCErrorCodeUnavailable
diff --git a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h
index 8d3c45e..cb55e46 100644
--- a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h
+++ b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h
@@ -57,6 +57,6 @@
  * Only one handler is active at a time, so if this method is called again before the previous
  * handler has been called, it might never be called at all (or yes, if it has already been queued).
  */
-- (void)handleLossWithHandler:(nullable void (^)())lossHandler
-      wifiStatusChangeHandler:(nullable void (^)())wifiStatusChangeHandler;
+- (void)handleLossWithHandler:(nullable void (^)(void))lossHandler
+      wifiStatusChangeHandler:(nullable void (^)(void))wifiStatusChangeHandler;
 @end
diff --git a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m
index b322638..c8e10dd 100644
--- a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m
+++ b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m
@@ -136,8 +136,8 @@
   return returnValue;
 }
 
-- (void)handleLossWithHandler:(nullable void (^)())lossHandler
-      wifiStatusChangeHandler:(nullable void (^)())wifiStatusChangeHandler {
+- (void)handleLossWithHandler:(nullable void (^)(void))lossHandler
+      wifiStatusChangeHandler:(nullable void (^)(void))wifiStatusChangeHandler {
   __weak typeof(self) weakSelf = self;
   [self startListeningWithHandler:^(GRPCReachabilityFlags *flags) {
     typeof(self) strongSelf = weakSelf;
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index f73e9cb..a0f4118 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -93,7 +93,7 @@
     if (!connectivityMonitor) {
       connectivityMonitor =
       [GRPCConnectivityMonitor monitorWithHost:hostURL.host];
-      void (^handler)() = ^{
+      void (^handler)(void) = ^{
         [GRPCHost flushChannelCache];
       };
       [connectivityMonitor handleLossWithHandler:handler
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
index 1cd9da8..f569895 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
@@ -30,24 +30,24 @@
 @interface GRPCOpSendMetadata : GRPCOperation
 
 - (instancetype)initWithMetadata:(NSDictionary *)metadata
-                         handler:(void(^)())handler;
+                         handler:(void(^)(void))handler;
 
 - (instancetype)initWithMetadata:(NSDictionary *)metadata
                            flags:(uint32_t)flags
-                         handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
+                         handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
 
 @end
 
 @interface GRPCOpSendMessage : GRPCOperation
 
 - (instancetype)initWithMessage:(NSData *)message
-                        handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
+                        handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
 
 @end
 
 @interface GRPCOpSendClose : GRPCOperation
 
-- (instancetype)initWithHandler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithHandler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
 
 @end
 
@@ -79,7 +79,7 @@
                         path:(NSString *)path
                      timeout:(NSTimeInterval)timeout NS_DESIGNATED_INITIALIZER;
 
-- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)())errorHandler;
+- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)(void))errorHandler;
 
 - (void)startBatchWithOperations:(NSArray *)ops;
 
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
index b0b1223..d26d134 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
@@ -36,12 +36,12 @@
   // Most operation subclasses don't set any flags in the grpc_op, and rely on the flag member being
   // initialized to zero.
   grpc_op _op;
-  void(^_handler)();
+  void(^_handler)(void);
 }
 
 - (void)finish {
   if (_handler) {
-    void(^handler)() = _handler;
+    void(^handler)(void) = _handler;
     _handler = nil;
     handler();
   }
@@ -55,13 +55,13 @@
 }
 
 - (instancetype)initWithMetadata:(NSDictionary *)metadata
-                         handler:(void (^)())handler {
+                         handler:(void (^)(void))handler {
   return [self initWithMetadata:metadata flags:0 handler:handler];
 }
 
 - (instancetype)initWithMetadata:(NSDictionary *)metadata
                            flags:(uint32_t)flags
-                         handler:(void (^)())handler {
+                         handler:(void (^)(void))handler {
   if (self = [super init]) {
     _op.op = GRPC_OP_SEND_INITIAL_METADATA;
     _op.data.send_initial_metadata.count = metadata.count;
@@ -92,7 +92,7 @@
   return [self initWithMessage:nil handler:nil];
 }
 
-- (instancetype)initWithMessage:(NSData *)message handler:(void (^)())handler {
+- (instancetype)initWithMessage:(NSData *)message handler:(void (^)(void))handler {
   if (!message) {
     [NSException raise:NSInvalidArgumentException format:@"message cannot be nil"];
   }
@@ -116,7 +116,7 @@
   return [self initWithHandler:nil];
 }
 
-- (instancetype)initWithHandler:(void (^)())handler {
+- (instancetype)initWithHandler:(void (^)(void))handler {
   if (self = [super init]) {
     _op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
     _handler = handler;
@@ -271,7 +271,7 @@
   [self startBatchWithOperations:operations errorHandler:nil];
 }
 
-- (void)startBatchWithOperations:(NSArray *)operations errorHandler:(void (^)())errorHandler {
+- (void)startBatchWithOperations:(NSArray *)operations errorHandler:(void (^)(void))errorHandler {
   // Keep logs of op batches when we are running tests. Disabled when in production for improved
   // performance.
 #ifdef GRPC_TEST_OBJC
diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h
index cec45fa..f16a3d0 100644
--- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h
+++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h
@@ -46,7 +46,7 @@
  * Enqueues writeValue: to be sent to the writeable in the main thread.
  * The passed handler is invoked from the main thread after writeValue: returns.
  */
-- (void)enqueueValue:(id)value completionHandler:(void (^)())handler;
+- (void)enqueueValue:(id)value completionHandler:(void (^)(void))handler;
 
 /**
  * Enqueues writesFinishedWithError:nil to be sent to the writeable in the main thread. After that
diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m
index bbfe491..37bc975 100644
--- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m
+++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m
@@ -50,7 +50,7 @@
                    dispatchQueue:dispatch_get_main_queue()];
 }
 
-- (void)enqueueValue:(id)value completionHandler:(void (^)())handler {
+- (void)enqueueValue:(id)value completionHandler:(void (^)(void))handler {
   dispatch_async(_writeableQueue, ^{
     // We're racing a possible cancellation performed by another thread. To turn all already-
     // enqueued messages into noops, cancellation nillifies the writeable property. If we get it
diff --git a/src/objective-c/RxLibrary/GRXImmediateWriter.h b/src/objective-c/RxLibrary/GRXImmediateWriter.h
index bdcf5d5..f88e46b 100644
--- a/src/objective-c/RxLibrary/GRXImmediateWriter.h
+++ b/src/objective-c/RxLibrary/GRXImmediateWriter.h
@@ -46,7 +46,7 @@
  * Returns a writer that pushes to its writeable the successive values returned by the passed
  * block. When the block first returns nil, it is released.
  */
-+ (GRXWriter *)writerWithValueSupplier:(id (^)())block;
++ (GRXWriter *)writerWithValueSupplier:(id (^)(void))block;
 
 /**
  * Returns a writer that iterates over the values of the passed container and pushes them to
diff --git a/src/objective-c/RxLibrary/GRXImmediateWriter.m b/src/objective-c/RxLibrary/GRXImmediateWriter.m
index d8c6975..c5d6d13 100644
--- a/src/objective-c/RxLibrary/GRXImmediateWriter.m
+++ b/src/objective-c/RxLibrary/GRXImmediateWriter.m
@@ -52,7 +52,7 @@
   return [self writerWithEnumerator:enumerator error:nil];
 }
 
-+ (GRXWriter *)writerWithValueSupplier:(id (^)())block {
++ (GRXWriter *)writerWithValueSupplier:(id (^)(void))block {
   return [self writerWithEnumerator:[NSEnumerator grx_enumeratorWithValueSupplier:block]];
 }
 
diff --git a/src/objective-c/RxLibrary/GRXWriter+Immediate.h b/src/objective-c/RxLibrary/GRXWriter+Immediate.h
index 292a35f..d7935de 100644
--- a/src/objective-c/RxLibrary/GRXWriter+Immediate.h
+++ b/src/objective-c/RxLibrary/GRXWriter+Immediate.h
@@ -30,7 +30,7 @@
  * Returns a writer that pushes to its writeable the successive values returned by the passed
  * block. When the block first returns nil, it is released.
  */
-+ (instancetype)writerWithValueSupplier:(id (^)())block;
++ (instancetype)writerWithValueSupplier:(id (^)(void))block;
 
 /**
  * Returns a writer that iterates over the values of the passed container and pushes them to
diff --git a/src/objective-c/RxLibrary/GRXWriter+Immediate.m b/src/objective-c/RxLibrary/GRXWriter+Immediate.m
index 43aa9c5..a36a567 100644
--- a/src/objective-c/RxLibrary/GRXWriter+Immediate.m
+++ b/src/objective-c/RxLibrary/GRXWriter+Immediate.m
@@ -27,7 +27,7 @@
   return [GRXImmediateWriter writerWithEnumerator:enumerator];
 }
 
-+ (instancetype)writerWithValueSupplier:(id (^)())block {
++ (instancetype)writerWithValueSupplier:(id (^)(void))block {
   return [GRXImmediateWriter writerWithValueSupplier:block];
 }
 
diff --git a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h
index 8c72f78..38dbaaf 100644
--- a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h
+++ b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h
@@ -38,5 +38,5 @@
  * Returns a NSEnumerator instance that delegates the invocations of nextObject to the passed block.
  * When the block first returns nil, it is released.
  */
-+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)())block;
++ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)(void))block;
 @end
diff --git a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m
index 309e25e..7d8191d 100644
--- a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m
+++ b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m
@@ -33,7 +33,7 @@
   return [[GRXNSScalarEnumerator alloc] initWithValue:value];
 }
 
-+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)())block {
++ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)(void))block {
   return [[GRXNSBlockEnumerator alloc] initWithValueSupplier:block];
 }
 @end
diff --git a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h
index c45338a..c3317b2 100644
--- a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h
+++ b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h
@@ -27,5 +27,5 @@
  * The first time the passed block returns nil, the enumeration will end and the block will be
  * released.
  */
-- (instancetype)initWithValueSupplier:(id (^)())block;
+- (instancetype)initWithValueSupplier:(id (^)(void))block;
 @end
diff --git a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m
index 7e7cc57..eddfd26 100644
--- a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m
+++ b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m
@@ -19,14 +19,14 @@
 #import "GRXNSBlockEnumerator.h"
 
 @implementation GRXNSBlockEnumerator {
-  id (^_block)();
+  id (^_block)(void);
 }
 
 - (instancetype)init {
   return [self initWithValueSupplier:nil];
 }
 
-- (instancetype)initWithValueSupplier:(id (^)())block {
+- (instancetype)initWithValueSupplier:(id (^)(void))block {
   if ((self = [super init])) {
     _block = block;
   }
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
index ae1e1a0..c2698d1 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
@@ -337,7 +337,7 @@
 typedef grpc_call_credentials*(*grpc_google_compute_engine_credentials_create_type)(void* reserved);
 extern grpc_google_compute_engine_credentials_create_type grpc_google_compute_engine_credentials_create_import;
 #define grpc_google_compute_engine_credentials_create grpc_google_compute_engine_credentials_create_import
-typedef gpr_timespec(*grpc_max_auth_token_lifetime_type)();
+typedef gpr_timespec(*grpc_max_auth_token_lifetime_type)(void);
 extern grpc_max_auth_token_lifetime_type grpc_max_auth_token_lifetime_import;
 #define grpc_max_auth_token_lifetime grpc_max_auth_token_lifetime_import
 typedef grpc_call_credentials*(*grpc_service_account_jwt_access_credentials_create_type)(const char* json_key, gpr_timespec token_lifetime, void* reserved);
@@ -589,7 +589,7 @@
 typedef void(*gpr_set_allocation_functions_type)(gpr_allocation_functions functions);
 extern gpr_set_allocation_functions_type gpr_set_allocation_functions_import;
 #define gpr_set_allocation_functions gpr_set_allocation_functions_import
-typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)();
+typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)(void);
 extern gpr_get_allocation_functions_type gpr_get_allocation_functions_import;
 #define gpr_get_allocation_functions gpr_get_allocation_functions_import
 typedef gpr_avl(*gpr_avl_create_type)(const gpr_avl_vtable* vtable);
@@ -712,7 +712,7 @@
 typedef void(*gpr_set_log_verbosity_type)(gpr_log_severity min_severity_to_print);
 extern gpr_set_log_verbosity_type gpr_set_log_verbosity_import;
 #define gpr_set_log_verbosity gpr_set_log_verbosity_import
-typedef void(*gpr_log_verbosity_init_type)();
+typedef void(*gpr_log_verbosity_init_type)(void);
 extern gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
 #define gpr_log_verbosity_init gpr_log_verbosity_init_import
 typedef void(*gpr_set_log_function_type)(gpr_log_func func);