Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings issue found in conformance_test_runner#8189 #8190

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/binary_json_conformance_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions conformance/conformance_test_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void ForkPipeRunner::SpawnTestProgram() {

std::vector<const char *> 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);
Expand All @@ -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<size_t>(write(fd, buf, len)) != len) {
GOOGLE_LOG(FATAL) << current_test_name_
<< ": error writing to test program: " << strerror(errno);
}
Expand Down