kernel: Remove NONNULL annotation from destroy method #34982

pull alexanderwiederin wants to merge 1 commits into bitcoin:master from alexanderwiederin:remove-non-null-block-validation changing 1 files +1 −1
  1. alexanderwiederin commented at 11:36 am on April 1, 2026: contributor

    Follow-up to #33796 (review)

    Summary

    This PR removes the BITCOINKERNEL_ARG_NONNULL annotation from the btck_block_validation_state_destroy method in the Kernel API.

    Motivation

    No other *_destroy function in the Kernel API carries the NONNULL annotation. Following the convention set by free(), destroy functions should accept null pointers.

    Usage:

    Before:

    0btck_BlockValidationState* state = NULL;
    1btck_block_validation_state_destroy(state); // violates nonnull contract
    

    After:

    0btck_BlockValidationState* state = NULL;
    1btck_block_validation_state_destroy(state); // well-defined
    
  2. kernel: Remove NONNULL annotation from destroy method
    No other *_destroy function in the Kernel API carries this annotation.
    Following the convention set by free(), destroy functions should accept
    null pointers.
    75608547b4
  3. DrahtBot added the label Validation on Apr 1, 2026
  4. DrahtBot commented at 11:36 am on April 1, 2026: contributor

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

    Reviews

    See the guideline for information on the review process.

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. ?
    added_to_project_v2 fanquake
  6. ?
    project_v2_item_status_changed github-project-automation[bot]
  7. ?
    project_v2_item_status_changed alexanderwiederin
  8. janb84 commented at 12:46 pm on April 1, 2026: contributor

    ACK 75608547b469b72caa890c8b356d0d3284998701

    This PR fixes an inconsistency in the kernel api where btck_block_validation_state_destroy was the only _destroy function left annotated. After this change every kernel api _destroy function adheres to the free() convention.

    LGTM

  9. theStack approved
  10. theStack commented at 2:03 pm on April 1, 2026: contributor

    ACK 75608547b469b72caa890c8b356d0d3284998701

    Verified that this is consistent with all other btck_...destroy API functions and that delete nullptr is a defined no-op in C++.

  11. yuvicc commented at 2:19 pm on April 1, 2026: contributor
    lgtm! ACK 75608547b469b72caa890c8b356d0d3284998701
  12. kevkevinpal commented at 3:47 pm on April 1, 2026: contributor

    ACK 7560854

    Similar to theStack I checked to make sure none of the btck_.*destroy functions behaved a similar way

  13. w0xlt commented at 5:35 pm on April 1, 2026: contributor
    ACK 75608547b469b72caa890c8b356d0d3284998701
  14. stickies-v approved
  15. stickies-v commented at 6:06 pm on April 1, 2026: contributor
    ACK 75608547b469b72caa890c8b356d0d3284998701
  16. achow101 commented at 6:28 pm on April 1, 2026: member
    ACK 75608547b469b72caa890c8b356d0d3284998701
  17. achow101 merged this on Apr 1, 2026
  18. achow101 closed this on Apr 1, 2026

  19. ?
    project_v2_item_status_changed github-project-automation[bot]
  20. fanquake commented at 2:46 am on April 3, 2026: member
    Backported to 31.x in #34942.

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

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