C标准库源码解剖(9)
23. 如果定义了NDEBUG

,什么也不做。如果没有定义,且ERRNUM为0,则打
印对应于错误码ERRNUM的错误消息,
24. 然后终止程序 */
25. # ifdef __USE_GNU
26. # define assert_perror(errnum) (__ASSERT_VOID_CAST (0))
27. # endif
28. #else /* 没有定义NDEBUG */
29. #ifndef _ASSERT_H_DECLS
30. #define _ASSERT_H_DECLS
31. __BEGIN_DECLS
32. /* 这里打印一条“断言失败”的消息,然后终止程序 */
33. extern void __assert_fail (__const char *__assertion, __const char *__file,
34. unsigned int __line, __const char *__function)
35. __THROW __attribute__ ((__noreturn__));
36. /* 与上面一样,但打印错误码ERRNUM的错误消息 */
37. extern void __assert_perror_fail (int __errnum, __const char *__file,
38. unsigned int __line,
39. __const char *__function)
40. __THROW __attribute__ ((__noreturn__));
41.
42. /* 下面的函数在这里并没有使用,但为了与标准兼容,还是需要提供 */
43. extern void __assert (const char *__assertion, const char *__file, int __line)
44. __THROW __attribute__ ((__noreturn__));
45.
46. __END_DECLS
47. #endif /* Not _ASSERT_H_DECLS */
48. /* 使用上面的函数来定义完整的assert宏 */
49. # define assert(expr) /
50. ((expr) /
51. ? __ASSERT_VOID_CAST (0) /
52. : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCT
ION))
53. # ifdef __USE_GNU
54. # define assert_perror(errnum) /
55. (!(errnum) /
c标准库<assert.h>:诊断 <assert.h>中只定义了...<ctype.h>中定义的标准函数列 表如下: <ctype.h...Longjmp with value 1 一般地, setjmp 和 longjmp ...
c 语言函数库 第一章(C 标准库) 1. 2. 3. ...10 1. <assert.h>:诊断 <assert.h>中只定义了...Longjmp with value 1 一般地, setjmp 和 longjmp ...
诊断<assert.h>......信号处理<signal.h>......C 标准库函数,但没有列出一些用途有限的函数以及某些可以简单的从其 他函数合成的函数,也没有包含多字节和...
标准语言概述函数库简介 C语言标准库的历史 标准库...在C89标准中: <assert.h> <ctype.h> <errno.h...setjmp.h signal.h 嵌入式家园 www.embedclub.com...
表 9-1 标准库函数 <assert.h> <ctype.h> <...<signal.h> <stdarg.h> <stddef.h> <stdio.h...<setjmp.h>中定义了两个宏: int setjmp(jmp_buf...
c语言函数库-第一章(C标准库)_IT/计算机_专业...10 1. <assert.h>:诊断 : <assert.h>中只定义...Longjmp with value 1 一般地, setjmp 和 longjmp ...
C标准库函数集(头文件索引)_IT/计算机_专业资料...诊断<assert.h>......8.1 setjmp #include <setjmp.h> int setjmp(jmp_buf env); setjmp()宏把...
<assert.h>:诊断 <assert.h>中只定义了一个带参...<setjmp.h>中定义了两个宏: int setjmp(jmp_buf...在<signal.h>中只定义了两个函数: int signal(...
热门文档