[KongchangAI]
Concept

NDEBUG

C 标准库约定的预处理宏,定义后会使 assert 展开为空语句从而在编译期移除断言,是 C/C++ 构建配置中控制断言行为的传统机制

Timeline (last 90 days)

Oct 16

The debug breakpoints provided by <debugging> are not affected by the NDEBUG macro and should be available under all build configurations.

Unverified50%
Oct 16

When NDEBUG is defined (usually in Release builds), the assert macro is expanded to a no-op.

Unverified50%
Oct 15

When the NDEBUG macro is defined, the standard header <cassert> expands assert(expr) into an empty statement, thereby completely removing the assertion at compile time.

Unverified50%
Oct 15

NDEBUG is global and cannot be controlled differentially per function, per module, or per class condition.

Unverified50%

All Facts (4)

Source Articles