Can't Happen or /* NOTREACHED */ or Real Programs Dump Core*
Can't Happen or /* NOTREACHED */ or Real Programs Dump Core*
复制标题
不可能发生或 /* 未达到 */ 或真实程序转储核心*
DOI:
--
复制
发表时间:
1989
期刊:
影响因子:
--
通讯作者:
Geoffrey Allen Collyer
中科院分区:
文献类型:
--
作者:
I. Darwin;Geoffrey Allen Collyer
UNIX† programmers too often fail to check for failure of system calls or functions, taking the familiar teen-age attitude that ‘‘it can’t happen to me (or my program)’’. This paper will attempt to convince its audience to take prophylactic measures. Those who take such measures will be healthier − and less prone to surprises − than those who don’t take such measures. In the tradition of the classic Elements of Programming Style some real-world programs will be criticised publicly. Actual production (or soi-disant production) UNIX programs and subsystems will be examined. Each of these ‘‘provides one or more lessons in style.’’ We present both before and after versions of most code fragments.