From 930815b0cd7abf56a0d2203ddb04d106c0b545a3 Mon Sep 17 00:00:00 2001 From: Abhishek Jain Date: Thu, 7 Jan 2021 11:11:44 +0530 Subject: [PATCH] Fix compiler warnings issue found in conformance_test_runner#8189 Signed-off-by: Abhishek Jain --- conformance/binary_json_conformance_suite.cc | 2 +- conformance/conformance_test_runner.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conformance/binary_json_conformance_suite.cc b/conformance/binary_json_conformance_suite.cc index 4a0d8e848048..48bfa9660fa1 100644 --- a/conformance/binary_json_conformance_suite.cc +++ b/conformance/binary_json_conformance_suite.cc @@ -300,7 +300,7 @@ const FieldDescriptor* GetFieldForOneofType(FieldDescriptor::Type type, } string UpperCase(string str) { - for (int i = 0; i < str.size(); i++) { + for (size_t i = 0; i < str.size(); i++) { str[i] = toupper(str[i]); } return str; diff --git a/conformance/conformance_test_runner.cc b/conformance/conformance_test_runner.cc index 9f893cb8e704..1572ac03b5f4 100644 --- a/conformance/conformance_test_runner.cc +++ b/conformance/conformance_test_runner.cc @@ -297,7 +297,7 @@ void ForkPipeRunner::SpawnTestProgram() { std::vector argv; argv.push_back(executable.get()); - for (int i = 0; i < executable_args_.size(); ++i) { + for (size_t i = 0; i < executable_args_.size(); ++i) { argv.push_back(executable_args_[i].c_str()); } argv.push_back(nullptr); @@ -307,7 +307,7 @@ void ForkPipeRunner::SpawnTestProgram() { } void ForkPipeRunner::CheckedWrite(int fd, const void *buf, size_t len) { - if (write(fd, buf, len) != len) { + if (static_cast(write(fd, buf, len)) != len) { GOOGLE_LOG(FATAL) << current_test_name_ << ": error writing to test program: " << strerror(errno); }