From 1b36bf0c5d71ea2e7e3595eb10611ea1a8c3a0d1 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 23 Jan 2026 13:41:50 +0000 Subject: [PATCH] subprocess: Fix `-Wunused-private-field` for `Child` class on Windows When compiling with clang-cl on Windows, `src/util/subprocess.h` emits `-Wunused-private-field` warnings about unused private fields in the `Child` class. --- src/util/subprocess.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/subprocess.h b/src/util/subprocess.h index e261215cc50..87a7e49cf60 100644 --- a/src/util/subprocess.h +++ b/src/util/subprocess.h @@ -738,6 +738,7 @@ private: Popen* popen_ = nullptr; }; +#ifndef __USING_WINDOWS__ /*! * A helper class to Popen. * This takes care of all the fork-exec logic @@ -759,6 +760,7 @@ private: Popen* parent_ = nullptr; int err_wr_pipe_ = -1; }; +#endif // Fwd Decl. class Streams; @@ -932,7 +934,9 @@ class Popen { public: friend struct detail::ArgumentDeducer; +#ifndef __USING_WINDOWS__ friend class detail::Child; +#endif template Popen(const std::string& cmd_args, Args&& ...args): @@ -1275,8 +1279,8 @@ namespace detail { } - inline void Child::execute_child() { #ifndef __USING_WINDOWS__ + inline void Child::execute_child() { int sys_ret = -1; auto& stream = parent_->stream_; @@ -1336,8 +1340,8 @@ namespace detail { // Calling application would not get this // exit failure _exit (EXIT_FAILURE); -#endif } +#endif inline void Streams::setup_comm_channels()