clang-tidy: Disable UndefinedBinaryOperatorResult check in src/ipc #33312

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:250904-capnp-tidy changing 2 files +5 −0
  1. hebasto commented at 10:09 pm on September 4, 2025: member

    The warnings are false positive and have been fixed upstream. See: https://github.com/capnproto/capnproto/pull/2334.

    This PR:

    1. Disables the UndefinedBinaryOperatorResult clang-tidy check for source files generated by the mpgen tool.

    2. Is an alternative to the draft #33281.

    3. Fixes #33256.

  2. clang-tidy: Disable `UndefinedBinaryOperatorResult` check in `src/ipc`
    The warnings are false positive and have been fixed upstream.
    See: https://github.com/capnproto/capnproto/pull/2334.
    
    This change disables the `UndefinedBinaryOperatorResult` clang-tidy
    check for source files generated by the `mpgen` tool.
    589b65f06c
  3. hebasto added this to the milestone 30.0 on Sep 4, 2025
  4. DrahtBot commented at 10:09 pm on September 4, 2025: 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/33312.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Sjors, fjahr, ryanofsky, achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. Sjors commented at 6:47 am on September 8, 2025: member

    ACK 589b65f06c3376df4cde3fac5c1d39a2d3254920

    Is it possible to move this into the capnp subdirectory to further narrow the scope of this exception?

  6. hebasto commented at 9:08 am on September 8, 2025: member

    Is it possible to move this into the capnp subdirectory to further narrow the scope of this exception?

    The most recent CI log shows false-positive clang-analyzer-core.UndefinedBinaryOperatorResult warnings in the following files:

    • /home/admin/actions-runner/_work/_temp/build/src/ipc/capnp/init.capnp.proxy-server.c++
    • /home/admin/actions-runner/_work/_temp/build/src/ipc/capnp/echo.capnp.proxy-server.c++
    • /home/admin/actions-runner/_work/_temp/build/src/ipc/capnp/mining.capnp.proxy-server.c++
    • /home/admin/actions-runner/_work/_temp/build/src/ipc/libmultiprocess/test/mp/test/foo.capnp.proxy-server.c++

    The last file is clearly outside of the src/ipc/capnp directory.

    Also note that the scope of the new .clang-tidy file is limited to generated files only.

  7. fjahr commented at 3:01 pm on September 8, 2025: contributor

    ACK 589b65f06c3376df4cde3fac5c1d39a2d3254920

    Looks cleaner than the alternative #33281 with the limited scope.

    Does it actually make sense at all to run clang-tidy on files that are auto generated by an upstream library? I guess that discussion is out of the scope for this PR/v30 but I am wondering what the upside of that is…

  8. ryanofsky approved
  9. ryanofsky commented at 4:27 pm on September 8, 2025: contributor

    Code review ACK 589b65f06c3376df4cde3fac5c1d39a2d3254920. Thanks for the fix!

    It could make sense to make a similar change in the libmultiprocess repository, so the src/ipc/libmultiprocess/ directory would be covered and this fix could be moved to src/ipc/capnp/ instead of src/ipc/, but current approach seems simpler and in the long run when https://github.com/capnproto/capnproto/pull/2334 rolls out, or the LLVM isInMainFile check works better, this can be dropped.

    Not running clang-tidy on generated files is another possible fix, but IMO it is good to fix tidy and analyzer errors even in generated files, and so far we’ve been able to do that without too much trouble. This error doesn’t even really come from a generated file, it comes from a header file included by generated files.

  10. achow101 commented at 8:27 pm on September 8, 2025: member
    ACK 589b65f06c3376df4cde3fac5c1d39a2d3254920
  11. achow101 merged this on Sep 8, 2025
  12. achow101 closed this on Sep 8, 2025

  13. hebasto deleted the branch on Sep 8, 2025

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: 2025-10-10 21:13 UTC

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