aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Barenblat <benjamin@barenblat.name>2018-07-11 13:20:01 -0400
committerThomas Van Lenten <thomasvl@google.com>2018-07-11 13:20:01 -0400
commit048f5c26a783f5f92061aec3aab19986e5c8d435 (patch)
tree74fe45ea33ccb4ae295f5359d875ac345db8d837
parent237938ac6ae07d732e1147073ab3569379c313a5 (diff)
downloadprotobuf-048f5c26a783f5f92061aec3aab19986e5c8d435.tar.gz
protobuf-048f5c26a783f5f92061aec3aab19986e5c8d435.tar.bz2
protobuf-048f5c26a783f5f92061aec3aab19986e5c8d435.zip
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.
-rw-r--r--BUILD3
-rw-r--r--objectivec/Tests/GPBTestUtilities.m2
2 files changed, 4 insertions, 1 deletions
diff --git a/BUILD b/BUILD
index 7f7ec759..df9867b6 100644
--- a/BUILD
+++ b/BUILD
@@ -934,6 +934,9 @@ OBJC_SRCS = [
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 ebccaac9..0362bdde 100644
--- a/objectivec/Tests/GPBTestUtilities.m
+++ b/objectivec/Tests/GPBTestUtilities.m
@@ -85,7 +85,7 @@ const uint32_t kGPBDefaultRepeatCount = 2;
NSLog(@"Wrote data file to %@", path);
#else
// Kill off the unused variable warning.
- dataToWrite = dataToWrite;
+ (void)dataToWrite;
#endif
return data;
}