From 2b36223b470948d708bd6582d92800ae59cdd9e8 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 16 Jan 2025 16:36:14 +0000 Subject: [PATCH] Fix gcc build Signed-off-by: Dom Del Nano --- src/common/exec/exec.cc | 10 +++++++++- src/e2e_test/vizier/planner/BUILD.bazel | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common/exec/exec.cc b/src/common/exec/exec.cc index b75ae3521c2..fce99420e99 100644 --- a/src/common/exec/exec.cc +++ b/src/common/exec/exec.cc @@ -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 Exec(std::string cmd) { - std::unique_ptr pipe(popen(cmd.c_str(), "r"), pclose); + std::unique_ptr pipe(popen(cmd.c_str(), "r")); if (pipe == nullptr) { return error::Internal("popen() failed!"); } diff --git a/src/e2e_test/vizier/planner/BUILD.bazel b/src/e2e_test/vizier/planner/BUILD.bazel index 4936df535ec..57ebdbd4893 100644 --- a/src/e2e_test/vizier/planner/BUILD.bazel +++ b/src/e2e_test/vizier/planner/BUILD.bazel @@ -24,7 +24,6 @@ pl_go_test( ], tags = [ "no_asan", - "no_gcc", "no_msan", "no_tsan", ],