How to put assert into release builds in C/C++

前端 未结 7 1078
野性不改
野性不改 2020-12-24 02:18

I need to only run ship build and I need to assert on certain condition in release build to see if the problem is fixed. How do I do it?

相关标签:
7条回答
  • 2020-12-24 03:22

    Actually - I'd go with shipping the debug version if you can live with it. If you don't need the performance of the release version, use the debug. It tend's to have fewer bugs (this is a gross oversimplification and if you program is free of bugs, just switching to release does not change this, but due to things the compiler does in debug mode, the bugs may not occur and/or have less severe consequences).

    Perhaps it is also possible to optimize only the time critical parts of you program.

    It can also simplify debugging.

    0 讨论(0)
提交回复
热议问题