Code Monkey home page Code Monkey logo

Comments (5)

theuni avatar theuni commented on July 30, 2024

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.

sipa avatar sipa commented on July 30, 2024

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.

gmaxwell avatar gmaxwell commented on July 30, 2024

We should probably not use assert.h. We should use local debugging macros instead. It would resolve that issue nicely...

from secp256k1.

theuni avatar theuni commented on July 30, 2024

@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.

sipa avatar sipa commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.