Comments (3)
I don't think that's a concern. If a backward-compatible API change causes 0 to become a permitted return value, it shouldn't occur for code written against the old header file (e.g. it'd require API calls, or constants, or magics, ... that don't exist in the old header). Thus, to any user of the old header file, no warning should be needed, and the WARN_UNUSED_RESULT can just be added to the header whenever such an API change is introduced.
TL;DR: I think we should drop SECP256K1_WARN_UNUSED_RESULT
for functions that are defined to only return 1.
from secp256k1.
Why do
secp256k1_keypair_*
functions haveSECP256K1_WARN_UNUSED_RESULT
if they always return 1 ?
Because they are not guaranteed to always return 1 in future (but backwards-compatible) API versions, I suppose.
from secp256k1.
These functions can actually return 0, but this requires a violation of the API:
secp256k1/src/modules/extrakeys/main_impl.h
Lines 44 to 54 in b40e2d3
Wouldn't it make more sense to call the illegal callback in that case?
from secp256k1.
Related Issues (20)
- build: benchmarks and examples should be disabled when external callbacks are enabled HOT 4
- build error: implicit declaration of function 'time' is invalid in C99 HOT 2
- Wrong documentation for secp256k1_ec_seckey_tweak_add
- secp256k1_u128_rshift should use __shiftright128 intrinsic on MSVC
- ci: MSVC fails after rebuild of Docker image
- "sizeof(secp256k1_ge_storage) != 64" path not tested HOT 1
- scalar: Verify invariants on every entry HOT 2
- `-Wmaybe-uninitialized` when compiling with `-O1` HOT 3
- Schnorr is not compatible with BIP340 HOT 5
- group: ge(j) should have as invariant that the curve equation holds HOT 3
- Policy for VERIFY_CHECK and #ifdef VERIFY HOT 5
- ci: Add a "compile the headers" job
- ci: Add a constant-time test job that uses MSan HOT 2
- ci: Future of CI after Cirrus pricing change HOT 37
- mingw-w64: "visibility attribute not supported in this configuration; ignored" under `-flto` HOT 5
- Silent Payments (BIP352) module -- discussion about scope and interface HOT 2
- Compile with: --with-ecmult-window=24 --with-ecmult-gen-precision=8
- ARM assembly: "missing .note.GNU-stack section implies executable stack" with recent ld
- ci: Random Valgrind MacOS build failures HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from secp256k1.