...
首页> 外文期刊>ACM SIGPLAN Notices: A Monthly Publication of the Special Interest Group on Programming Languages >An approach to improving the structure of error-handling code in the linux kernel
【24h】

An approach to improving the structure of error-handling code in the linux kernel

机译:一种改善Linux内核中错误处理代码结构的方法

获取原文
获取原文并翻译 | 示例
           

摘要

The C language does not provide any abstractions for exception handling or other forms of error handling, leaving programmers to devise their own conventions for detecting and handling errors. The Linux coding style guidelines suggest placing error handling code at the end of each function, where it can be reached by gotos whenever an error is detected. This coding style has the advantage of putting all of the error-handling code in one place, which eases understanding and maintenance, and reduces code duplication. Nevertheless, this coding style is not always applied. In this paper, we propose an automatic program transformation that transforms error-handling code into this style.We have applied our transformation to the Linux 2.6.34 kernel source code, on which it reorganizes the error handling code of over 1800 functions, in about 25 minutes.
机译:C语言不提供用于异常处理或其他形式的错误处理的任何抽象,从而使程序员可以设计自己的约定来检测和处理错误。 Linux编码风格指南建议将错误处理代码放在每个函数的末尾,每当检测到错误时,gotos都可以在其中找到它。这种编码风格的优点是将所有错误处理代码放在一个位置,这便于理解和维护,并减少了代码重复。但是,这种编码方式并不总是适用。在本文中,我们提出了一种自动程序转换,将错误处理代码转换为这种样式。我们已将转换应用到Linux 2.6.34内核源代码,在该源代码上重组了1800多个函数的错误处理代码。 25分钟

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号