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

ASSERTS in RELEASE mode #115

Open
strasdat opened this issue Aug 19, 2023 · 1 comment
Open

ASSERTS in RELEASE mode #115

strasdat opened this issue Aug 19, 2023 · 1 comment

Comments

@strasdat
Copy link
Member

review / design behavior of ASSERT macros when compiled in RELEASE mode

options

  • turn then all off
  • turn them into warnings (no aborts)
  • leave them as is, but introduce DASSERT macros which only fire in DEBUG or in DEBUG+RelWithDebInfo mode
  • etc.

There is no plan to chnge behavior for ASSERTs in DEBUG and RelWithDebInfo modes.

@wylderkeane
Copy link
Contributor

I generally think leaving assert statements active in release mode when they prevent undefined behavior in the system. A quick crash is better than having undefined behavior that may lead to corrupt data or other undesirable results. This, combined with caching core dumps will allow us to more quickly root cause the bad behavior and fix it.

That said, for any assert statements that can actually be handled gracefully we should convert to a warning and continue or return gracefully. In other words, we should not assert on bad input when there's a way to continue executing without compromising the program behavior.

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

2 participants