-
Notifications
You must be signed in to change notification settings - Fork 38.8k
subprocess: Fix -Wunused-private-field when building with clang-cl on Windows
#34385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.