Is there an automatic way to remove debugging methods for a release build?

Posted by Lewis on Stack Overflow See other posts from Stack Overflow or by Lewis
Published on 2010-12-23T23:43:35Z Indexed on 2010/12/23 23:54 UTC
Read the original article Hit count: 157

Filed under:
|
|
|
|

Note: This is an extension of an earlier question I asked here: Do additional function/method definitions increase a program's memory footprint?

When I write a class, I usually end up writing several testing/debugging methods, used to make sure the class works as it should, or for printing data to help with debugging, or for unit testing, etc. Is there an easy/automatic way to make a release without these methods, or do I need to manually delete the extra code any time I want to compile a release version?

I ask this question both from a C++ and a Java perspective. I'm using Code::Blocks and Eclipse as IDEs, if that plays into the answer somehow.

© Stack Overflow or respective owner

Related posts about java

Related posts about c++