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..a8855d423ade 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,8 @@ void ForkPipeRunner::SpawnTestProgram() { } void ForkPipeRunner::CheckedWrite(int fd, const void *buf, size_t len) { - if (write(fd, buf, len) != len) { + size_t bytes_write = write(fd, buf, len); + if (bytes_write != len) { GOOGLE_LOG(FATAL) << current_test_name_ << ": error writing to test program: " << strerror(errno); }