Registered Member
|
Hi,
in nesting_ops.cpp test, there is this code: #ifdef NDEBUG const bool is_debug = false; #else const bool is_debug = true; #endif // Make really sure that we are in debug mode! We don't want any type of // inlining for these tests to pass. VERIFY(is_debug); First of all, I'm just curious, why are you relying on debug mode? At least for now, it seams that the subsequent tests succeed as well if NDEBUG is defined. My second question is, on Win EC, the test fails because NDEBUG is defined, which happens somewhere in Eigen/Core, which is included in main.h after NDEBUG is undefined. Does anyone know where this happens? I tried to narrow down, but could not find a single file in the Eigen src that defines NDEBUG and that is included (directly or via another file) in eigen/Core. Thanks, Christian |
Moderator
|
NDEBUG is never defined by Eigen itself. What if you add:
at the beginning of the nested_ops.cpp file? Maybe NDEBUG is defined by some system headers of win EC? Actually, if EIGEN_NO_DEBUG or NDEBUG are defined before main.h, then we should undefined them. Then, if they are still defined afterwards, then we should abort compilation. And last, this VERIFY(is_debug); test should be replaced by a VERIFY_RAISE_ASSERT(eigen_assert(false)); |
Registered Member
|
Thanks for your reply.
Your proposed code ends in NDEBUG defined after main.h. I actually did the whole exercise and found the NDEBUG definition in Windows CE's assert.h included by cassert included within Eigen/Core on line ~140. In assert.h is the following code:
DEBUG is not defined here, and therefore NDEBUG gets defined. To be honest, I don't have any idea why they check for DEBUG and not for _DEBUG. _DEBUG is actually defined at that point as it should be. I don't know where MS expects DEBUG to be defined, however. I assume this is just another one of these CE specific bugs or inconsistencies. |
Moderator
|
thanks:
https://bitbucket.org/eigen/eigen/commits/8054d6c46825/ Changeset: 8054d6c46825 User: ggael Date: 2013-07-01 13:47:25 Summary: On windows CE, assert.h defines NDEBUG if DEBUG is not defined |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]