-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Remove redundant NDEBUG preprocessor checks #17459
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
Remove redundant NDEBUG preprocessor checks #17459
Conversation
Since commit 7cee858 ("Add compile time verification of assumptions we're currently making implicitly/tacitly"), this check is done in compat/assumptions.h which is included by util/system.h, which is in turn included by most .cpp files, including the ones this commit modifies.
f9f952b to
7f3397b
Compare
|
I'm all for removing redundancies in the general case, but in this specific case the redundancy is intentional: Note that the inclusion of Thus we cannot assume that I think of it this way:
Does that make sense? :) |
|
@practicalswift: Thanks for clarifying! Still feels odd to have the exact same preprocessor construct and error string scattered aorund in three places in the same project, but I get your point. |
|
Tend toward NACK. |
|
Yeah, if the goal is to make sure the assert can never be disabled by accident, but also avoid these preprocessor checks, you could cherry-pick something like fa15643, replace the |
|
Though, I'd say it's not much of a goal in itself. Wouldn't be surprised if the preprocessor is the least CPU intensive part of the C++ compilation process. |
|
Closing as something that we can potentially revisit in the future. |
Since commit 7cee858 ("Add compile time verification of assumptions we're currently making implicitly/tacitly", PR #15391), this check is done in
compat/assumptions.h:bitcoin/src/compat/assumptions.h
Lines 13 to 18 in 8237889
This header is included by
util/system.h, which is in turn included by most .cpp files, including the ones this commit modifies (validation.cppandnet_processing.cpp).