Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace <cassert> usage with a PANIC based assert #505

Closed
pflanze opened this issue Jul 3, 2024 · 3 comments
Closed

Replace <cassert> usage with a PANIC based assert #505

pflanze opened this issue Jul 3, 2024 · 3 comments

Comments

@pflanze
Copy link
Contributor

pflanze commented Jul 3, 2024

The assert from #include <cassert> aborts on failures. Instead write one that uses our new PANIC macro, and include or use that instead.

@pflanze pflanze mentioned this issue Jul 3, 2024
2 tasks
@pflanze
Copy link
Contributor Author

pflanze commented Jul 3, 2024

As per @Taepper's hint, C's (cassert) assert is eliminated if -DNDEBUG (https://en.cppreference.com/w/cpp/error/assert). Could emulate this.

Or could e.g. offer an ASSERT which checks the assertion even if NDEBUG is set, and an NASSERT which behaves like assert from C. Because most assertions could stay in release builds without the performance downside (Todo: overview over other project's approaches.)

@Taepper
Copy link
Collaborator

Taepper commented Jul 4, 2024

I see, I like this, fill me in on the details on Monday?

@fengelniederhammer
Copy link
Contributor

Was done by #546 and #571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants