type-number: fix clang-tidy modernize-use-nullptr #292

pull ViniciusCestarii wants to merge 1 commits into bitcoin-core:master from ViniciusCestarii:type-number-use-nullptr changing 1 files +1 −1
  1. ViniciusCestarii commented at 6:43 PM on June 9, 2026: contributor

    Prevent warning --modernize-use-nullptr when using clang-tidy on downstream projects (Noticed when pushing https://github.com/2140-dev/bitcoin/pull/42, this change was also necessary for https://github.com/bitcoin/bitcoin/pull/29409 so CI doens't error)

  2. tidy fix: modernize-use-nullptr 91a951f59a
  3. DrahtBot commented at 6:43 PM on June 9, 2026: none

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Stale ACK ryanofsky

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. maflcko commented at 6:53 PM on June 9, 2026: contributor

    Looks like CI fails in mptest, which may be unrelated.

    Also, I wonder why the CI passes fine without this change, when it does claim to run clang-tidy: https://github.com/bitcoin-core/libmultiprocess/blob/61de6975362a7070276da47cc2aa2c2b8909ed49/ci/configs/llvm.bash#L8

  5. ViniciusCestarii commented at 7:50 PM on June 9, 2026: contributor

    Also, I wonder why the CI passes fine without this change, when it does claim to run clang-tidy:

    The CI does run clang-tidy, but it only warns about code that actually gets compiled. The float overload of CustomReadField (the one with = 0) is a template, so it only turns into real code when something uses a float type. libmultiprocess's own foo.capnp has no Float64 field, so that code is never generated and clang-tidy never looks at it. Bitcoin Core's .capnp does use Float64, so mpgen generates the code, and then clang-tidy can see the type and warn with modernize-use-nullptr.

    Adding a Float64 field on foo.capnp and foo.h would have triggered this error here. I believe there other types that are not being tested too.

  6. ViniciusCestarii commented at 7:57 PM on June 9, 2026: contributor

    Looks like CI fails in mptest, which may be unrelated.

    The same thing happened on #278 which only changes a markdown file. I will give a look on what's happening

  7. ryanofsky approved
  8. ryanofsky commented at 8:06 PM on June 9, 2026: collaborator

    Code review ACK 91a951f59ac9e43e408456bf052b9fb1179563a6. Thanks for the PR. It could also be a good to add a test that would trigger this error. I guess would just need to add a test passing a floating point value.

  9. ryanofsky merged this on Jun 9, 2026
  10. ryanofsky closed this on Jun 9, 2026

  11. maflcko commented at 7:16 AM on June 10, 2026: contributor

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-06-24 04:30 UTC

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