diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2016-05-25 13:46:00 -0400 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2016-05-25 16:42:31 -0400 |
commit | c8a440dfb68074ff310e624928cd2dd61c101728 (patch) | |
tree | 6b2251c56e7ccd125a7cc7bcb9fc276266f5adc5 /objectivec/GPBUtilities_PackagePrivate.h | |
parent | d089f04ae53565aff77240172e1007f3959503f4 (diff) | |
download | protobuf-c8a440dfb68074ff310e624928cd2dd61c101728.tar.gz protobuf-c8a440dfb68074ff310e624928cd2dd61c101728.tar.bz2 protobuf-c8a440dfb68074ff310e624928cd2dd61c101728.zip |
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.
Diffstat (limited to 'objectivec/GPBUtilities_PackagePrivate.h')
-rw-r--r-- | objectivec/GPBUtilities_PackagePrivate.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/objectivec/GPBUtilities_PackagePrivate.h b/objectivec/GPBUtilities_PackagePrivate.h index a6b6c84d..c02493b2 100644 --- a/objectivec/GPBUtilities_PackagePrivate.h +++ b/objectivec/GPBUtilities_PackagePrivate.h @@ -52,7 +52,7 @@ CF_EXTERN_C_BEGIN // generated sources to make sure they are linked with a supporting runtime. void GPBCheckRuntimeVersionInternal(int32_t version); GPB_INLINE void GPBDebugCheckRuntimeVersion() { -#if DEBUG +#if defined(DEBUG) && DEBUG GPBCheckRuntimeVersionInternal(GOOGLE_PROTOBUF_OBJC_GEN_VERSION); #endif } @@ -125,6 +125,10 @@ GPB_INLINE uint64_t GPBEncodeZigZag64(int64_t n) { return (n << 1) ^ (n >> 63); } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + GPB_INLINE BOOL GPBDataTypeIsObject(GPBDataType type) { switch (type) { case GPBDataTypeBytes: @@ -187,6 +191,8 @@ GPB_INLINE void GPBSetHasIvarField(GPBMessage *self, GPBFieldDescriptor *field, void GPBMaybeClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof, int32_t oneofHasIndex, uint32_t fieldNumberNotToClear); +#pragma clang diagnostic pop + //%PDDM-DEFINE GPB_IVAR_SET_DECL(NAME, TYPE) //%void GPBSet##NAME##IvarWithFieldInternal(GPBMessage *self, //% NAME$S GPBFieldDescriptor *field, |