help with BOOST_DISABLE_ASSERTS
Hi All,
#define BOOST_DISABLE_ASSERTS
#include
AMDG er wrote:
#define BOOST_DISABLE_ASSERTS #include
#include int main(){ call(); return 0; };
If, for testing purposes, I define call() as BOOST_ASSERT(false); with or without -O2 as a compiler option, there are no assert failed messages during execution, as desired.
In my actual program, however, call depends on many headers. If I artificially add BOOST_ASSERT(false); in one of them, it is not ignored with -O2 i.e. I get Assertion failed: (false), function call. I use i686-apple-darwin9-gcc-4.0.1.
Am I using BOOST_DISABLE_ASSERTS correctly? How do I go about fixing this problem?
You're probably not defining BOOST_DISABLE_ASSERTS before including boost/assert.hpp. As I recall, the definition of BOOST_ASSERT can be changed by changing BOOST_DISABLE_ASSERTS and reincluding boost/assert.hpp In Christ, Steven Watanabe
You're probably not defining BOOST_DISABLE_ASSERTS before including boost/assert.hpp. As I recall, the definition of BOOST_ASSERT can be changed by changing BOOST_DISABLE_ASSERTS and reincluding boost/assert.hpp
Thanks. This works in Release mode: #ifdef NDEBUG #define BOOST_DISABLE_ASSERTS #endif I would have thought that BOOST_DISABLE_ASSERTS would also be defined without the #ifdef condition but ...
participants (2)
-
er
-
Steven Watanabe