subprocess: Fix -Wunused-private-field when building with clang-cl on Windows #34385

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:260122-clangcl-unsused changing 1 files +9 −5
  1. hebasto commented at 10:26 pm on January 22, 2026: member

    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:

    0D:\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]
    1D:\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]
    2D:\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.

  2. hebasto added the label Refactoring on Jan 22, 2026
  3. hebasto added the label Windows on Jan 22, 2026
  4. DrahtBot commented at 10:26 pm on January 22, 2026: contributor

    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.

  5. in src/util/subprocess.h:938 in d39e9d68a6 outdated
    933@@ -932,7 +934,9 @@ class Popen
    934 {
    935 public:
    936   friend struct detail::ArgumentDeducer;
    937+#ifndef __USING_WINDOWS__
    938   friend class detail::Child;
    


    fanquake commented at 10:48 am on January 23, 2026:
    Can these be fixed with a few [[maybe_unused]] rather than a bunch of #ifdefs and shuffling code around?

    maflcko commented at 12:30 pm on January 23, 2026:
    i think it is fine to not compile fork-exec-child on Windows, if it doesn’t exist there conceptually.

    hebasto commented at 1:05 pm on January 23, 2026:
    The point was to make these changes compatible with the upstream, which uses C++11 standard.
  6. fanquake commented at 12:15 pm on January 23, 2026: member

    Context and details can be found in #31507 (review).

    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.

  7. subprocess: Fix `-Wunused-private-field` for `Popen` class on Windows
    When compiling with clang-cl on Windows, `src/util/subprocess.h` emits
    `-Wunused-private-field` warnings about unused private fields in the
    `Popen` class.
    9f2b338bc0
  8. subprocess: Fix `-Wunused-private-field` for `Child` class on Windows
    When compiling with clang-cl on Windows, `src/util/subprocess.h` emits
    `-Wunused-private-field` warnings about unused private fields in the
    `Child` class.
    1b36bf0c5d
  9. hebasto force-pushed on Jan 23, 2026
  10. hebasto commented at 1:42 pm on January 23, 2026: member

    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.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-01-27 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me