From f9731fdf731d4983425c08ebccea0c398569f769 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Fri, 23 Feb 2024 07:08:34 -0800 Subject: [PATCH] [ObjC] Fix potential `-Wstrict-prototypes` warning. PiperOrigin-RevId: 609718293 --- objectivec/GPBAny.pbobjc.m | 2 +- objectivec/GPBDuration.pbobjc.m | 2 +- objectivec/GPBTimestamp.pbobjc.m | 2 +- src/google/protobuf/compiler/objectivec/file.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/objectivec/GPBAny.pbobjc.m b/objectivec/GPBAny.pbobjc.m index 65207e8293..2e3b86c2b1 100644 --- a/objectivec/GPBAny.pbobjc.m +++ b/objectivec/GPBAny.pbobjc.m @@ -43,7 +43,7 @@ static GPBFileDescription GPBAnyRoot_FileDescription = { // This is to help make sure that the GPBWellKnownTypes.* categories get linked and // developers do not have to use the `-ObjC` linker flag. More information // here: https://medium.com/ios-os-x-development/categories-in-static-libraries-78e41f8ddb96 -__attribute__((used)) static NSString* any_importCategories () { +__attribute__((used)) static NSString* any_importCategories(void) { return GPBWellKnownTypesErrorDomain; } diff --git a/objectivec/GPBDuration.pbobjc.m b/objectivec/GPBDuration.pbobjc.m index 124342f5e5..5919d5ef98 100644 --- a/objectivec/GPBDuration.pbobjc.m +++ b/objectivec/GPBDuration.pbobjc.m @@ -43,7 +43,7 @@ static GPBFileDescription GPBDurationRoot_FileDescription = { // This is to help make sure that the GPBWellKnownTypes.* categories get linked and // developers do not have to use the `-ObjC` linker flag. More information // here: https://medium.com/ios-os-x-development/categories-in-static-libraries-78e41f8ddb96 -__attribute__((used)) static NSString* duration_importCategories () { +__attribute__((used)) static NSString* duration_importCategories(void) { return GPBWellKnownTypesErrorDomain; } diff --git a/objectivec/GPBTimestamp.pbobjc.m b/objectivec/GPBTimestamp.pbobjc.m index faf201519b..3cad69933e 100644 --- a/objectivec/GPBTimestamp.pbobjc.m +++ b/objectivec/GPBTimestamp.pbobjc.m @@ -43,7 +43,7 @@ static GPBFileDescription GPBTimestampRoot_FileDescription = { // This is to help make sure that the GPBWellKnownTypes.* categories get linked and // developers do not have to use the `-ObjC` linker flag. More information // here: https://medium.com/ios-os-x-development/categories-in-static-libraries-78e41f8ddb96 -__attribute__((used)) static NSString* timestamp_importCategories () { +__attribute__((used)) static NSString* timestamp_importCategories(void) { return GPBWellKnownTypesErrorDomain; } diff --git a/src/google/protobuf/compiler/objectivec/file.cc b/src/google/protobuf/compiler/objectivec/file.cc index 9066f63dcf..db95c4eefc 100644 --- a/src/google/protobuf/compiler/objectivec/file.cc +++ b/src/google/protobuf/compiler/objectivec/file.cc @@ -155,7 +155,7 @@ void EmitLinkWKTs(absl::string_view name, io::Printer* p) { // This is to help make sure that the GPBWellKnownTypes.* categories get linked and // developers do not have to use the `-ObjC` linker flag. More information // here: https://medium.com/ios-os-x-development/categories-in-static-libraries-78e41f8ddb96 - __attribute__((used)) static NSString* $basename$_importCategories () { + __attribute__((used)) static NSString* $basename$_importCategories(void) { return GPBWellKnownTypesErrorDomain; } )objc");