Skip to content

Commit 3f54ed8

Browse files
Merge #1659: include: remove WARN_UNUSED_RESULT for functions always returning 1
1b6e081 include: remove WARN_UNUSED_RESULT for functions always returning 1 (Jonas Nick) Pull request description: This makes the usage of the atribute consistent. In the musig and ellswift module, functions that return 1 always already don't have the WARN_UNUSED_RESULT attribute. In secp256k1.h and the extrakeys module, this has only been the case partially. In all cases where this was removed, the function only returns 0 if the illegal callback has been called. Fixes #1379 ACKs for top commit: real-or-random: utACK 1b6e081 sipa: utACK 1b6e081 Tree-SHA512: 5d1f2563ddde34fb721dd0b96622e0888a9c72f95af6f1c8a94f7f1f72ca934b6af98a3357c1e922d8611a9869264bb0f3ceb7bed0164c6c3a6f92f9950d4f19
2 parents e56716a + 1b6e081 commit 3f54ed8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/secp256k1.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_negate(
707707
* Args: ctx: pointer to a context object
708708
* In/Out: pubkey: pointer to the public key to be negated.
709709
*/
710-
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_negate(
710+
SECP256K1_API int secp256k1_ec_pubkey_negate(
711711
const secp256k1_context *ctx,
712712
secp256k1_pubkey *pubkey
713713
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);
@@ -857,7 +857,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_combine(
857857
* msg: pointer to an array containing the message
858858
* msglen: length of the message array
859859
*/
860-
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_tagged_sha256(
860+
SECP256K1_API int secp256k1_tagged_sha256(
861861
const secp256k1_context *ctx,
862862
unsigned char *hash32,
863863
const unsigned char *tag,

include/secp256k1_extrakeys.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ SECP256K1_API int secp256k1_xonly_pubkey_cmp(
9090
* the negation of the pubkey and set to 0 otherwise.
9191
* In: pubkey: pointer to a public key that is converted.
9292
*/
93-
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_xonly_pubkey_from_pubkey(
93+
SECP256K1_API int secp256k1_xonly_pubkey_from_pubkey(
9494
const secp256k1_context *ctx,
9595
secp256k1_xonly_pubkey *xonly_pubkey,
9696
int *pk_parity,
@@ -179,7 +179,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_create(
179179
* Out: seckey: pointer to a 32-byte buffer for the secret key.
180180
* In: keypair: pointer to a keypair.
181181
*/
182-
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_sec(
182+
SECP256K1_API int secp256k1_keypair_sec(
183183
const secp256k1_context *ctx,
184184
unsigned char *seckey,
185185
const secp256k1_keypair *keypair
@@ -192,7 +192,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_sec(
192192
* Out: pubkey: pointer to a pubkey object, set to the keypair public key.
193193
* In: keypair: pointer to a keypair.
194194
*/
195-
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_pub(
195+
SECP256K1_API int secp256k1_keypair_pub(
196196
const secp256k1_context *ctx,
197197
secp256k1_pubkey *pubkey,
198198
const secp256k1_keypair *keypair
@@ -211,7 +211,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_pub(
211211
* pk_parity argument of secp256k1_xonly_pubkey_from_pubkey.
212212
* In: keypair: pointer to a keypair.
213213
*/
214-
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_xonly_pub(
214+
SECP256K1_API int secp256k1_keypair_xonly_pub(
215215
const secp256k1_context *ctx,
216216
secp256k1_xonly_pubkey *pubkey,
217217
int *pk_parity,

0 commit comments

Comments
 (0)