Annotate all static int functions in the library (non-test code) with SECP256K1_WARN_UNUSED_RESULT so that compilers can warn when return values are accidentally discarded. This covers ~140 functions across all modules.
Changes:
- Add
SECP256K1_WARN_UNUSED_RESULTto field, scalar, group, eckey, ecmult, ecdsa, int128 utility functions and all module header/impl files - Fix call sites where return values were being discarded:
secp256k1_ec_pubkey_combine: checkpubkey_loadreturnsecp256k1_ecdh: checkpubkey_loadreturnsecp256k1_ellswift_swiftec_var,ellswift_xdh: use assignment patternbench_internal.c,bench_ecmult.c, test files: wrap inCHECK()
- Exclude
scalar_addandscalar_cond_negatewhose returns are intentionally informational/redundant at all existing call sites
See #1610 for prior discussion.