Skip to content

Commit

Permalink
Fix gcc build
Browse files Browse the repository at this point in the history
Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano committed Jan 16, 2025
1 parent 955ca1b commit 2b36223
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/common/exec/exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@

namespace px {

// GCC's ingnored-attribute warning is triggered without wrapping pclose. This is likely do to the
// nonnull attribute.
struct pclose_deleter {
void operator()(FILE* file) const {
pclose(file);
}
};

StatusOr<std::string> Exec(std::string cmd) {
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
std::unique_ptr<FILE, pclose_deleter> pipe(popen(cmd.c_str(), "r"));
if (pipe == nullptr) {
return error::Internal("popen() failed!");
}
Expand Down
1 change: 0 additions & 1 deletion src/e2e_test/vizier/planner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pl_go_test(
],
tags = [
"no_asan",
"no_gcc",
"no_msan",
"no_tsan",
],
Expand Down

0 comments on commit 2b36223

Please sign in to comment.