Tuesday, August 15, 2006

Good Debugging Tip: Release and Debug Builds Should Behave the Same

Here's a post I read on The Old New Thing: Do not change program semantics in the debug build. This is great reminder that you shouldn't ever trap errors, return from a function, or otherwise change the behavior of the program between debug and release builds when executing code residing in an #ifdef DEBUG block.

As the author says, "if the retail build crashes, then the debug build must also crash in the same way."

No comments: