aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/google/protobuf/generated_message_reflection.h2
-rw-r--r--src/google/protobuf/wire_format.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h
index ed4e03348..4f25d4b3e 100644
--- a/src/google/protobuf/generated_message_reflection.h
+++ b/src/google/protobuf/generated_message_reflection.h
@@ -635,6 +635,8 @@ template<typename To, typename From>
inline To dynamic_cast_if_available(From from) {
#if defined(GOOGLE_PROTOBUF_NO_RTTI) || defined(__GXX_RTTI) || \
(defined(_MSC_VER)&&!defined(_CPPRTTI))
+ // Avoid the compiler warning about unused variables.
+ (void)from;
return NULL;
#else
return dynamic_cast<To>(from);
diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h
index 941be75ba..5b41aadf1 100644
--- a/src/google/protobuf/wire_format.h
+++ b/src/google/protobuf/wire_format.h
@@ -326,6 +326,9 @@ inline void WireFormat::VerifyUTF8StringNamedField(
#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
WireFormatLite::VerifyUtf8String(
data, size, static_cast<WireFormatLite::Operation>(op), field_name);
+#else
+ // Avoid the compiler warning about unused variables.
+ (void)data; (void)size; (void)op; (void)field_name;
#endif
}