![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SsC&Plus
文章平均质量分 81
tyjhField
这个作者很懒,什么都没留下…
展开
-
巧妙的静态断言
利用C/C++的语法语义的定义,可以巧妙地完成断言使命:数组长度>0 , switch中case分支不能重复 ,“位域( bitfield )必须具有非零长度“【1】。 1.数组长度>0 “通常,静态断言的机制是定义一个数组,并将表达式的布尔结果作为数组的大小......."。【1】 ”考虑下面的例子: #define STATIC_ASSERT(x) int ar转载 2012-11-21 21:44:53 · 920 阅读 · 0 评论 -
点滴1@glibc
void (*signal (int sig, void (*handler)(int)))(int) 复杂 -> 拆开看glibc/signal/signal.h/* Type of a signal handler. */ typedef void (*__sighandler_t) (int);glibc/signal/signal.c/* Set the handler for ...转载 2018-02-08 21:26:33 · 263 阅读 · 0 评论 -
点滴2@glibc
依赖于系统的实现,替换common实现。在glibc/include/signal.c中,发现singal函数直接报错。/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free so...转载 2018-02-08 22:09:03 · 492 阅读 · 0 评论