Bug #12181 2007-10-15 20:18
rhf
NDEBUG should be defined for Release code
Please consider defining NDEBUG when a Release Build is compiled. This macro is used to eliminate the standard c fcn assert() in Release code.
The macro can be defined already on a project basis, but, for correctness, it should be defined by default for all Release builds.
Thanks,
Bob
- Category
- Application::WrongBehaviour
- Group
- Status
- Closed
- Close date
- 2008-01-12 09:59
- Assigned to
History
It definitely should NOT be defined by default for all Release builds. Actually there is no such thing as "Release build" in C::B. It is just simple target created by scripted wizard. Don't know if it would be a good idea to define NDEBUG in these scripts...
I am confused by the comment that there is 'no such thing as "Release build" in C:B'.
The C:B compiler toolbar lists the two Build targets: Release and Debug.
To me, this is a very natural dichotomy. Release implies not debug and thus the ANSI NDEBUG macro seems appropriate.
But then, perhaps I have been corrupted by my years of using the Microsoft IDE, which by default does define NDEBUG for its Release builds.
Thanks.
Yes, debug/release are simple targets named as such only for convenience.
Therefore this is not a bug per-se. If you want this implemented though, post a feature request.