hi there
it seems like the optimiser removes assert() statements which it clearly shouldn't. assume the following file main.cpp:
#include <cassert>
int main(int argc, char** argv)
{
assert((argc & 1 ) == 0);
assert((argc & 2 ) == 0);
assert((argc & 4 ) == 0);
return argc;
}
compiled with no optimisation, all the asserts end up in the object file:
$ cl6x -O0 main.cpp
$ strings main.obj | grep Assertion
Assertion failed, ((argc & 1 ) == 0), file main.cpp, line 5
Assertion failed, ((argc & 2 ) == 0), file main.cpp, line 6
Assertion failed, ((argc & 4 ) == 0), file main.cpp, line 7