E521 subprocess: Fix `-Wunused-private-field` when building with clang-cl on Windows by hebasto · Pull Request #34385 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@hebasto
Copy link
Member
@hebasto hebasto commented Jan 22, 2026

This PR is a prerequisite for #31507.

It resolves -Wunused-private-field warnings triggered in src/util/subprocess.h when compiling with clang-cl on Windows:

D:\a\bitcoin\bitcoin\src\util/subprocess.h(759,10): warning : private field 'parent_' is not used [-Wunused-private-field] [D:\a\bitcoin\bitcoin\build\src\util\bitcoin_util.vcxproj]
D:\a\bitcoin\bitcoin\src\util/subprocess.h(760,7): warning : private field 'err_wr_pipe_' is not used [-Wunused-private-field] [D:\a\bitcoin\bitcoin\build\src\util\bitcoin_util.vcxproj]
D:\a\bitcoin\bitcoin\src\util/subprocess.h(1038,7): warning : private field 'child_pid_' is not used [-Wunused-private-field] [D:\a\bitcoin\bitcoin\build\src\util\bitcoin_util.vcxproj]

Only the second commit has been submitted upstream. The first commit is specific to this repository and not applicable upstream.

@DrahtBot
Copy link
Contributor
DrahtBot commented Jan 22, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34385.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Copy link
Member
@fanquake fanquake left a 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;
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member Author

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.
@hebasto hebasto force-pushed the 260122-clangcl-unsused branch from d39e9d6 to 1b36bf0 Compare January 23, 2026 13:42
@hebasto
Copy link
Member Author
hebasto commented Jan 23, 2026

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.

Thanks! Rewritten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0