Skip to content

Comments

Fix -Wunused-private-field when building with clang-cl on Windows#127

Merged
arun11299 merged 1 commit intoarun11299:masterfrom
hebasto:260122-clangcl-unused
Feb 18, 2026
Merged

Fix -Wunused-private-field when building with clang-cl on Windows#127
arun11299 merged 1 commit intoarun11299:masterfrom
hebasto:260122-clangcl-unused

Conversation

@hebasto
Copy link
Contributor

@hebasto hebasto commented Jan 22, 2026

Below are examples of such warnings:

> cmake -B build -T ClangCL -DSUBPROCESS_TESTS=ON
> cmake --build build
...
C:\Users\hebas\dev\cpp-subprocess\cpp-subprocess/subprocess.hpp(1190,10): warning : private field 'parent_' is not used [-Wunused-private-field] [C:\Users\hebas\dev\cpp-subprocess\build\test\test_subprocess.vcxproj]
C:\Users\hebas\dev\cpp-subprocess\cpp-subprocess/subprocess.hpp(1191,7): warning : private field 'err_wr_pipe_' is not used [-Wunused-private-field] [C:\Users\hebas\dev\cpp-subprocess\build\test\test_subprocess.vcxproj]

Ported from bitcoin/bitcoin#34385.

Copy link

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hebasto
Copy link
Contributor Author

hebasto commented Feb 17, 2026

Friendly ping @arun11299 :)

@arun11299 arun11299 merged commit bbf6d94 into arun11299:master Feb 18, 2026
3 checks passed
@hebasto hebasto deleted the 260122-clangcl-unused branch February 18, 2026 08:06
sedited added a commit to bitcoin/bitcoin that referenced this pull request Feb 19, 2026
…with clang-cl on Windows

1b36bf0 subprocess: Fix `-Wunused-private-field` for `Child` class on Windows (Hennadii Stepanov)
9f2b338 subprocess: Fix `-Wunused-private-field` for `Popen` class on Windows (Hennadii Stepanov)

Pull request description:

  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](arun11299/cpp-subprocess#127) upstream. The first commit is specific to this repository and not applicable upstream.

ACKs for top commit:
  maflcko:
    review ACK 1b36bf0 👋
  purpleKarrot:
    ACK 1b36bf0
  sedited:
    ACK 1b36bf0

Tree-SHA512: 1bc0544d769264fa74d2f39150595ee6339af4bca7b7051ecaecbe234c17b643b715e00cfb9302a16ffc4856957f4fa47c216aebf03fec0cd95c387f51bd29a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants