From 93bea3f8e4fedc0f63e4f7564662fe9036a99ee1 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 22 Jan 2026 22:06:43 +0000 Subject: [PATCH] Fix `-Wunused-private-field` when building with clang-cl on Windows --- cpp-subprocess/subprocess.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp-subprocess/subprocess.hpp b/cpp-subprocess/subprocess.hpp index 63fd762..da2d950 100644 --- a/cpp-subprocess/subprocess.hpp +++ b/cpp-subprocess/subprocess.hpp @@ -1169,6 +1169,7 @@ struct ArgumentDeducer Popen* popen_ = nullptr; }; +#ifndef __USING_WINDOWS__ /*! * A helper class to Popen. * This takes care of all the fork-exec logic @@ -1190,6 +1191,7 @@ class Child Popen* parent_ = nullptr; int err_wr_pipe_ = -1; }; +#endif // Fwd Decl. class Streams; @@ -1377,7 +1379,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): @@ -1891,8 +1895,8 @@ namespace detail { } - inline void Child::execute_child() { #ifndef __USING_WINDOWS__ + inline void Child::execute_child() { int sys_ret = -1; auto& stream = parent_->stream_; @@ -1985,8 +1989,8 @@ namespace detail { // Calling application would not get this // exit failure _exit (EXIT_FAILURE); -#endif } +#endif inline void Streams::setup_comm_channels()