From 048f5c26a783f5f92061aec3aab19986e5c8d435 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 11 Jul 2018 13:20:01 -0400 Subject: objectivec: Quash -Wself-assign and -Wvla (#4897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- BUILD | 3 +++ objectivec/Tests/GPBTestUtilities.m | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3