How can I completely disable calls to assert()?

前端 未结 5 1932
别跟我提以往
别跟我提以往 2020-11-28 08:02

My code is full of calls to assert(condition). In the debug version I use g++ -g which triggers my assertions. Unexpectedly, the same assertions ar

5条回答
  •  [愿得一人]
    2020-11-28 08:12

    Yes, define NDEBUG on the command line/build system with the preprocessor/compiler option -DNDEBUG.

    This has nothing to do with the debugging info inserted by -g.

提交回复
热议问题