Comments (5)
This pretty much comes down to maintainer preference. Most packages don't enable NDEBUG, rather they let the user handle it via ./configure CPPFLAGS=-DNDEBUG.
In reality, it's usually the distros that handle the above.
In this case, bench hard-coding NDEBUG makes sense, since it's not user-facing. One could possibly argue the same for the tests.
Another option is something like --enable-debug, on by default.
Preference?
from secp256k1.
I'd argue that a library whose primary purpose is efficiency can reasonably be expected to not build debug code by default, but maybe that's uncommon practice.
Of course, we could equally just replace assert() by a macro that only has an effect when VERIFY is defined? :)
from secp256k1.
We should probably not use assert.h. We should use local debugging macros instead. It would resolve that issue nicely...
from secp256k1.
@sipa: I would agree with that. Agree with @gmaxwell as well.
Since assert has performance implications, and is more complicated than simply "die here when debugging, and I guarantee we'll never get here in production", hard-coded -DNDEBUG and a custom secp_assert() with those simple semantics makes sense in this case.
from secp256k1.
Closing; #54 switched everything to our own CHECK/VERIFY_CHECK/DEBUG_CHECK macros. NDEBUG now only switches the public API input verification off.
from secp256k1.
Related Issues (20)
- 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
- Error: undefined symbol: secp256k1_ecdsa_recoverable_signature_parse_compact HOT 1
- Prefix all macros with SECP256K1_
- Add MuSig2 module HOT 6
- secp256k1_fe_set_b32_mod doesn't actually reduce anything HOT 4
- No implementation found HOT 2
- Add bitcoin as a topic to this repository HOT 1
- fe_sqr tests could be improved HOT 5
- docs: "pointer to context object" vs "context object"
- tests: Tidy the util functions HOT 2
- Rename.md
- Compiling for Windows 10
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.