From 8532804bad8bcc0def70d165ea420af53ed355e3 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Wed, 30 Jan 2019 17:45:18 +0100 Subject: [PATCH] Fixes warnings in https://github.com/google/oss-fuzz/issues/864#issuecomment-458596374 --- src/google/protobuf/arenastring.h | 2 ++ src/google/protobuf/util/field_comparator.h | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/google/protobuf/arenastring.h b/src/google/protobuf/arenastring.h index cb4dc8b3a..9234ee00f 100644 --- a/src/google/protobuf/arenastring.h +++ b/src/google/protobuf/arenastring.h @@ -195,6 +195,8 @@ struct PROTOBUF_EXPORT ArenaStringPtr { this_ptr->swap(*other_ptr); #else std::swap(ptr_, other->ptr_); + (void)default_value; + (void)arena; #endif } diff --git a/src/google/protobuf/util/field_comparator.h b/src/google/protobuf/util/field_comparator.h index 8c9528314..257f6ab8a 100644 --- a/src/google/protobuf/util/field_comparator.h +++ b/src/google/protobuf/util/field_comparator.h @@ -182,7 +182,7 @@ class PROTOBUF_EXPORT DefaultFieldComparator : public FieldComparator { // basic types (instead of submessages). They return true on success. One // can use ResultFromBoolean() to convert that boolean to a ComparisonResult // value. - bool CompareBool(const FieldDescriptor& field, bool value_1, bool value_2) { + bool CompareBool(const FieldDescriptor& /* unused */, bool value_1, bool value_2) { return value_1 == value_2; } @@ -199,27 +199,27 @@ class PROTOBUF_EXPORT DefaultFieldComparator : public FieldComparator { // CompareFloat. bool CompareFloat(const FieldDescriptor& field, float value_1, float value_2); - bool CompareInt32(const FieldDescriptor& field, int32 value_1, + bool CompareInt32(const FieldDescriptor& /* unused */, int32 value_1, int32 value_2) { return value_1 == value_2; } - bool CompareInt64(const FieldDescriptor& field, int64 value_1, + bool CompareInt64(const FieldDescriptor& /* unused */, int64 value_1, int64 value_2) { return value_1 == value_2; } - bool CompareString(const FieldDescriptor& field, const std::string& value_1, + bool CompareString(const FieldDescriptor& /* unused */, const std::string& value_1, const std::string& value_2) { return value_1 == value_2; } - bool CompareUInt32(const FieldDescriptor& field, uint32 value_1, + bool CompareUInt32(const FieldDescriptor& /* unused */, uint32 value_1, uint32 value_2) { return value_1 == value_2; } - bool CompareUInt64(const FieldDescriptor& field, uint64 value_1, + bool CompareUInt64(const FieldDescriptor& /* unused */, uint64 value_1, uint64 value_2) { return value_1 == value_2; }