Skip to content

Commit 1189702

Browse files
committed
Merge bitcoin/bitcoin#34982: kernel: Remove NONNULL annotation from destroy method
7560854 kernel: Remove NONNULL annotation from destroy method (Alexander Wiederin) Pull request description: Follow-up to bitcoin/bitcoin#33796 (comment) ### 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! ACK 7560854 kevkevinpal: ACK [7560854](bitcoin/bitcoin@7560854) achow101: ACK 7560854 janb84: ACK 7560854 theStack: ACK 7560854 w0xlt: ACK 7560854 stickies-v: ACK 7560854 Tree-SHA512: 9577098940f49b8f7fd1fb20afe750e9eaaf9d90d25ec3c4f423de223a1fbd0bca6d520061f576eb3923f18e1f2744b3f60d0d0715dfa3832fea83cb538170c2
2 parents 52c3381 + 7560854 commit 1189702

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/kernel/bitcoinkernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ BITCOINKERNEL_API btck_BlockValidationState* BITCOINKERNEL_WARN_UNUSED_RESULT bt
13441344
* Destroy the btck_BlockValidationState.
13451345
*/
13461346
BITCOINKERNEL_API void btck_block_validation_state_destroy(
1347-
btck_BlockValidationState* block_validation_state) BITCOINKERNEL_ARG_NONNULL(1);
1347+
btck_BlockValidationState* block_validation_state);
13481348

13491349
///@}
13501350

0 commit comments

Comments
 (0)