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

We change slightly on development checks are enabled. #1869

Merged
merged 3 commits into from
Jul 19, 2022

Conversation

lemire
Copy link
Member

@lemire lemire commented Jul 14, 2022

Currently, we enable the expensive development checks unless NDEBUG is set. Though it is true that CMake will often set NDEBUG, it is not set by default by C++ compilers. This means that some folks are getting development checks even in their release builds. This was never reported to us, but it might happen.

We still rely on NDEBUG, but for our asserts... So the users should still want to set NDEBUG, but it is a different purpose. (The development checks are much more than mere asserts, they allocate buffers and so forth.)

@jkeiser
Copy link
Member

jkeiser commented Jul 15, 2022

No issues here if that's actually happening--I'd be mortified if release builds had it on! The main purpose was to ensure dev checks were on by default in debug builds so that during debugging and testing you would get better information.

@lemire
Copy link
Member Author

lemire commented Jul 15, 2022

@jkeiser The thing is, if you do c++ -O3 mycode.cpp, it does not set NDEBUG. I think CMake sets NDEBUG, but you cannot be certain that this will hold generally.

We do have asserts that depend on NDEBUG, and enabling them is not free, but it is not comparable to the 'development checks'.

@lemire lemire merged commit 5dbe96d into master Jul 19, 2022
@lemire lemire deleted the dlemire/changing_dev_checks branch July 19, 2022 20:40
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

Successfully merging this pull request may close these issues.

None yet

2 participants