Git Product home page Git Product logo

Comments (7)

pchickey avatar pchickey commented on September 24, 2024

Thanks for the bug report. You're right, our current method for dealing with assertions is pretty anti-modular, and we should be able to do a lot better.

I'll talk with the rest of the team about this on Monday, and we'll come up with something that works with all of our existing Ivory targets, and allows the user to pick a more flexible assertion implementation.

from ivory.

leepike avatar leepike commented on September 24, 2024

I think @expipiplus1's suggestion is completely reasonable. Are there any reasons not to?

from ivory.

expipiplus1 avatar expipiplus1 commented on September 24, 2024

There may need to be a mechanism to put the users ivory_assert in scope everywhere.

from ivory.

pchickey avatar pchickey commented on September 24, 2024

I'd prefer not to give the user arbitrary control of includes and macros in the Ivory runtime if we can avoid it. Here is a proposed solution which allows the user to provide an assertion hook as a library. I made this a bit flexible with a verbose user hook as an option. This is configurable because users might not have room for __FILE__ and __LINE__ constants on embedded systems with limited program size.

from ivory.

expipiplus1 avatar expipiplus1 commented on September 24, 2024

Often it's nice to have the expression for arg as a string when printing asserts in addition to file and line.
Changing the line in the verbose definition for ivory_assert to ivory_user_verbose_assert_hook(atype, #arg, __FILE__, __LINE__);

from ivory.

pchickey avatar pchickey commented on September 24, 2024

That suggestion sounds good to me. I'll merge this with master as soon as we work out what the assert hooks will be for each of our user's platforms.

from ivory.

pchickey avatar pchickey commented on September 24, 2024

assert hooks are now in master. Thanks again for this bug report!

from ivory.

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.