From c0074f6e81857c5471bfc5ea0f847e74b236af1c Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Tue, 28 Feb 2017 12:09:21 -0800 Subject: Pull in two patches from protobuf upstream to suppress warnings This patch pull in two commits from upsteam of protobuf to suppress unused paramater warnings need in android builds. https://github.com/google/protobuf/commit/9079079ec0dac15700400a8c86b12595e9524901 https://github.com/google/protobuf/commit/a434bfc232de09de7d3ebc963290c960462212cb Test: None Change-Id: Ib399a495b7462b47cc7bd8f838bcaf31b70e66b5 --- src/google/protobuf/generated_message_reflection.h | 2 ++ src/google/protobuf/wire_format.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h index b6671ad06..e0e041ad0 100644 --- a/src/google/protobuf/generated_message_reflection.h +++ b/src/google/protobuf/generated_message_reflection.h @@ -491,6 +491,8 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection : public Reflection { template inline To dynamic_cast_if_available(From from) { #if defined(GOOGLE_PROTOBUF_NO_RTTI) || (defined(_MSC_VER)&&!defined(_CPPRTTI)) + // Avoid the compiler warning about unused variables. + (void)from; return NULL; #else return dynamic_cast(from); diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h index 9f26eb29b..c13ff5e0c 100644 --- a/src/google/protobuf/wire_format.h +++ b/src/google/protobuf/wire_format.h @@ -325,6 +325,9 @@ inline void WireFormat::VerifyUTF8StringNamedField( const char* field_name) { #ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED WireFormat::VerifyUTF8StringFallback(data, size, op, field_name); +#else + // Avoid the compiler warning about unused variables. + (void)data; (void)size; (void)op; (void)field_name; #endif } -- cgit v1.2.3