Recap: a lot of code is dead in assert() statements
Closed this issue · 1 comments
quiret commented
Examples:
https://github.com/aap/librw/blob/master/src/image.cpp#L65
https://github.com/aap/librw/blob/master/src/image.cpp#L179
https://github.com/aap/librw/blob/master/src/image.cpp#L241
https://github.com/aap/librw/blob/master/src/geometry.cpp#L106
- it never finds the chunk if asserts are disabled
https://github.com/aap/librw/blob/master/src/image.cpp#L528
- it never opens the file for writing TGA if asserts are disabled
In Release mode, some compilers like to put the preprocessor definition "NDEBUG" to disable things like the "assert" macro to speed up code. In return, your code breaks because assert statements do not execute in Release mode anymore. Please take a look at this issue. :)