C标准库源码解剖(9)
39. (void) fflush (stderr); /* 刷新标准错误流的状态(注意stderr并不缓冲) */
40. /* 我们要释放消息缓冲区,因为应用程序可能会捕捉到SIGABRT信号 */
41. free (buf);
42. }
43. else /* 消息写入未成功 */
44. {
45. /* 至少要打印一个最小的消息 */
46. static const char errstr[] = "Unexpected error./n";
47. __libc_write (STDERR_FILENO, errstr, sizeof (errstr) - 1);
48. }
49. abort (); /* 调用abort终止程序 */
50. }
51. hidden_def(__assert_fail)


1. /* assert-perr.c:assert_perror功能是GNU的一个扩展,核心的函数是
__assert_perror_fail */
2. #include <assert.h>
3. #include <libintl.h>
4. #include <stdio.h>
5. #include <stdlib.h>
6. #include <string.h>
7. #include <sysdep.h>
8. #include <unistd.h>
9.
10. extern const char *__progname;
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(...
热门文档