subprocess: Fix -Wunused-private-field when building with clang-cl on Windows#34385
subprocess: Fix -Wunused-private-field when building with clang-cl on Windows#34385hebasto wants to merge 2 commits intobitcoin:masterfrom
-Wunused-private-field when building with clang-cl on Windows#34385Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34385. ReviewsSee the guideline for information on the review process. |
fanquake
left a comment
There was a problem hiding this comment.
Context and details can be found in #31507 (comment).
Can you put the relevent context and details in this PR, and in the commit messages, rather than linking to a comment in a different PR.
| public: | ||
| friend struct detail::ArgumentDeducer; | ||
| #ifndef __USING_WINDOWS__ | ||
| friend class detail::Child; |
There was a problem hiding this comment.
Can these be fixed with a few [[maybe_unused]] rather than a bunch of #ifdefs and shuffling code around?
There was a problem hiding this comment.
i think it is fine to not compile fork-exec-child on Windows, if it doesn't exist there conceptually.
There was a problem hiding this comment.
The point was to make these changes compatible with the upstream, which uses C++11 standard.
When compiling with clang-cl on Windows, `src/util/subprocess.h` emits `-Wunused-private-field` warnings about unused private fields in the `Popen` class.
When compiling with clang-cl on Windows, `src/util/subprocess.h` emits `-Wunused-private-field` warnings about unused private fields in the `Child` class.
d39e9d6 to
1b36bf0
Compare
Thanks! Rewritten. |
This PR is a prerequisite for #31507.
It resolves
-Wunused-private-fieldwarnings triggered insrc/util/subprocess.hwhen compiling with clang-cl on Windows:Only the second commit has been submitted upstream. The first commit is specific to this repository and not applicable upstream.