objectivec: Quash -Wself-assign and -Wvla (#4897)
* objectivec: Quash -Wself-assign
* objectivec: Set -Wno-vla when building
Objective-C protobuf uses VLAs for performance reasons. Ensure Clang
doesn’t complain about them.
diff --git a/BUILD b/BUILD
index 7f7ec75..df9867b 100644
--- a/BUILD
+++ b/BUILD
@@ -934,6 +934,9 @@
objc_library(
name = "objectivec",
hdrs = OBJC_HDRS + OBJC_PRIVATE_HDRS,
+ copts = [
+ "-Wno-vla",
+ ],
includes = [
"objectivec",
],
diff --git a/objectivec/Tests/GPBTestUtilities.m b/objectivec/Tests/GPBTestUtilities.m
index ebccaac..0362bdd 100644
--- a/objectivec/Tests/GPBTestUtilities.m
+++ b/objectivec/Tests/GPBTestUtilities.m
@@ -85,7 +85,7 @@
NSLog(@"Wrote data file to %@", path);
#else
// Kill off the unused variable warning.
- dataToWrite = dataToWrite;
+ (void)dataToWrite;
#endif
return data;
}