assert() is always ignored #1455
-
There is a couple of places in simulator, there macro assert() is used. But the project is build so that NDEBUG is always defined, so assert() is always ignored (even in unit-tests) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is by design.
The correct way to build in Debug mode is
I personally do not encourage using |
Beta Was this translation helpful? Give feedback.
This is by design.
https://stackoverflow.com/questions/11778121/why-assert-macro-makes-use-only-for-debug-build
The correct way to build in Debug mode is
cmake -DCMAKE_BUILD_TYPE=Debug
.Your command line reports a error.
I personally do not encourage using
assert
macro. For the most of applications, if a proper set of unit tests is defined,, it can be avoided.