mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 21:57:54 +02:00
Merge bitcoin/bitcoin#34982: kernel: Remove NONNULL annotation from destroy method
75608547b4kernel: Remove NONNULL annotation from destroy method (Alexander Wiederin) Pull request description: Follow-up to https://github.com/bitcoin/bitcoin/pull/33796#discussion_r2959817508 ### 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: ```c btck_BlockValidationState* state = NULL; btck_block_validation_state_destroy(state); // violates nonnull contract ``` After: ```c btck_BlockValidationState* state = NULL; btck_block_validation_state_destroy(state); // well-defined ``` ACKs for top commit: yuvicc: lgtm! ACK75608547b4kevkevinpal: ACK [7560854](75608547b4) achow101: ACK75608547b4janb84: ACK75608547b4theStack: ACK75608547b4w0xlt: ACK75608547b4stickies-v: ACK75608547b4Tree-SHA512: 9577098940f49b8f7fd1fb20afe750e9eaaf9d90d25ec3c4f423de223a1fbd0bca6d520061f576eb3923f18e1f2744b3f60d0d0715dfa3832fea83cb538170c2
This commit is contained in:
@@ -1344,7 +1344,7 @@ BITCOINKERNEL_API btck_BlockValidationState* BITCOINKERNEL_WARN_UNUSED_RESULT bt
|
||||
* Destroy the btck_BlockValidationState.
|
||||
*/
|
||||
BITCOINKERNEL_API void btck_block_validation_state_destroy(
|
||||
btck_BlockValidationState* block_validation_state) BITCOINKERNEL_ARG_NONNULL(1);
|
||||
btck_BlockValidationState* block_validation_state);
|
||||
|
||||
///@}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user