已定义的宏 assert 指向另一个宏 NDEBUG,宏 NDEBUG 不是 <assert.h> 的一部分。如果已在引用 <assert.h> 的源文件中定义 NDEBUG 为宏名称,则 assert 宏的定义如下:
#define assert(ignore) ((void)0)
库宏
下面列出了头文件 assert.h 中定义的唯一的函数:
序号 | 函数 & 描述 |
---|---|
1 | void assert(int expression) 断言函数,用于在调试过程中捕捉程序错误 |
已定义的宏 assert 指向另一个宏 NDEBUG,宏 NDEBUG 不是 <assert.h> 的一部分。如果已在引用 <assert.h> 的源文件中定义 NDEBUG 为宏名称,则 assert 宏的定义如下:
#define assert(ignore) ((void)0)
下面列出了头文件 assert.h 中定义的唯一的函数:
序号 | 函数 & 描述 |
---|---|
1 | void assert(int expression) 断言函数,用于在调试过程中捕捉程序错误 |