Hi,
I frequently use assert() in my code development and was surprised when I got asserts in my Release build.
I guess I was expecting NDEBUG to be defined by default when building a Release build.
This is easy enough to fix on a project basis with Project->Build options->Release-># defines tab.
However, I would like to set this globally for all my Release builds.
In Settings->Compiler and debugger settings->Global compiler settings, I don't see how to distinguish Debug and Release targets.
Am I overlooking something?
Thanks.
our project wizards probably should take this issue into account.
will assert be gone with NDEBUG in all compilers, or is it different per compiler (GCC, MS, ...)
Quote from: killerbot on July 27, 2007, 06:52:51 PM
will assert be gone with NDEBUG in all compilers, or is it different per compiler (GCC, MS, ...)
Assert() is brought in with 'include <cassert>' (or <assert.h> in c).
It is a standard c function (or maybe macro in some implementations), so I assume that compliant C++ compilers support it.
By default the MS Visual C 6 IDE defines NDEBUG when building a Release version.
This is what I was expecting - or at least as a user option.
Thanks,
Yep, it's a standard feature that should probably be set up by the wizards.