C标准库源码解剖(9)
5. #include <stdlib.h>
6. #

include <sysdep.h>
7. #include <unistd.h>
8.
9. extern const char *__progname;
10. #ifdef USE_IN_LIBIO
11. # include <wchar.h>
12. # include <libio/iolibio.h>
13. # define fflush(s) INTUSE(_IO_fflush) (s)
14. #endif
15. /* 本函数当传递一个包含断言表达式的字符串、一个文件名、和一个行号时,在
标准
16. 错误流上用以下格式打印一条消息:
17. a.c:10: foobar: Assertion `a == b' failed.
18. 然后通过调用abort来终止程序的执行 */
19. #ifdef FATAL_PREPARE_INCLUDE
20. # include FATAL_PREPARE_INCLUDE
21. #endif
22. #undef __assert_fail
23. void
24. __assert_fail (const char *assertion, const char *file, unsigned int line,
25. const char *function)
26. {
27. char *buf;
28. #ifdef FATAL_PREPARE
29. FATAL_PREPARE;
30. #endif
31. /* 把指定格式的消息写入到buf中 */
32. if (__asprintf (&buf, _("%s%s%s:%u: %s%sAssertion `%s' failed./n"),
33. __progname, __progname[0] ? ": " : "",
34. file, line,
35. function ? function : "", function ? ": " : "",
36. assertion) >= 0)
37. {
38. (void) __fxprintf (NULL, "%s", buf); /* 打印buf中的消息 */
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(...
热门文档