From c8a440dfb68074ff310e624928cd2dd61c101728 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Wed, 25 May 2016 13:46:00 -0400 Subject: Add more warnings to for the ObjC runtime build Working on https://github.com/google/protobuf/issues/1599, specifically: - Turn on more warnings that the Xcode UI calls out with individual controls. - Manually add: -Wundef -Wswitch-enum - Manually add and then diable in the unittests because of XCTest's headers: -Wreserved-id-macro -Wdocumentation-unknown-command - Manually add -Wdirect-ivar-access, but disable it for the unittests and in the library code (via #pragmas to suppress it). This is done so proto users can enable the warning. --- objectivec/GPBArray.m | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'objectivec/GPBArray.m') diff --git a/objectivec/GPBArray.m b/objectivec/GPBArray.m index 426c7cbd..dce45b6e 100644 --- a/objectivec/GPBArray.m +++ b/objectivec/GPBArray.m @@ -32,6 +32,12 @@ #import "GPBMessage_PackagePrivate.h" +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + // Mutable arrays use an internal buffer that can always hold a multiple of this elements. #define kChunkSize 16 #define CapacityFromCount(x) (((x / kChunkSize) + 1) * kChunkSize) @@ -2532,3 +2538,5 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) { } @end + +#pragma clang diagnostic pop -- cgit v1.2.3