在阅读glibc源代码时,我偶然发现了assert.h中的这个注释:
/* The following is not at all used here but needed for standard
compliance. */
extern void __assert (const char *__assertion, const char *__file, int __line)
__THROW __attribute__ ((__noreturn__));
哪个标准规定了__assert
函数?
我在POSIX或C标准、git提交历史记录、网络或本站上都找不到相关信息。
__
(双下划线)的标识符都被保留供实现使用。因此,glibc(GNU C实现的一部分)可以自由地使用像__assert
这样的名称来表示其内部任何内容,而不会与符合标准的程序或库的任何用途发生冲突。 - undefined