开发者

When does GCC define NDEBUG? [duplicate]

开发者 https://www.devze.com 2023-01-05 18:27 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Where does the -DNDEBUG normally come from?
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Where does the -DNDEBUG normally come from?

I am using assertions in my code, but I don't know if they will trigger, because I don't know if NDEBUG is defined or not. Am I supposed to to s开发者_JS百科pecify the -DNDEBUG explicitly during compilation?


Yes. GCC by itself does not set that flag. It is usually set by the makefile generator, like Automake, CMake or QMake.

0

精彩评论

暂无评论...
验证码 换一张
取 消