I have quite a large piece of code, that works well in a development version, with many assert() in the code. I disabled assertions with -DNDEBUG directive passed to g++, and now my code breaks with seg. fault. Is there something I don’t know about assert()?
I have quite a large piece of code, that works well in a development
Share
The most common issue with assert to my knowledge is having code with side effects within the assert itself. When you compile with -DNDEBUG asserts are essentially commented out, and thus code inside the assert isn’t executed. The assert man page mentions this in the bugs section: