Skip to content

Commit

Permalink
Merge pull request iovisor#517 from vmg/vmg/clang-diag
Browse files Browse the repository at this point in the history
cc/clang: Use positional arguments for diagnostic messages
  • Loading branch information
4ast committed Apr 30, 2016
2 parents 75d62a0 + cc3a432 commit 8216464
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cc/frontends/clang/b_frontend_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
for (; table_it != tables_.end(); ++table_it)
if (table_it->name == Ref->getDecl()->getName()) break;
if (table_it == tables_.end()) {
error(Ref->getLocEnd(), "bpf_table %s failed to open") << Ref->getDecl()->getName();
error(Ref->getLocEnd(), "bpf_table %0 failed to open") << Ref->getDecl()->getName();
return false;
}
string fd = to_string(table_it->fd);
Expand Down Expand Up @@ -380,7 +380,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
prefix = "bpf_perf_event_read";
suffix = ")";
} else {
error(Call->getLocStart(), "invalid bpf_table operation %s") << memb_name;
error(Call->getLocStart(), "invalid bpf_table operation %0") << memb_name;
return false;
}
prefix += "((void *)bpf_pseudo_fd(1, " + fd + "), ";
Expand Down Expand Up @@ -617,7 +617,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
table.fd = bpf_create_map(map_type, table.key_size, table.leaf_size, table.max_entries);
}
if (table.fd < 0) {
error(Decl->getLocStart(), "could not open bpf map: %0\nis %s map type enabled in your kernel?") <<
error(Decl->getLocStart(), "could not open bpf map: %0\nis %1 map type enabled in your kernel?") <<
strerror(errno) << A->getName();
return false;
}
Expand Down

0 comments on commit 8216464

Please sign in to comment.