Abstract
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.
Original language | English |
---|---|
Title of host publication | Proceedings of the 2011 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systems |
Number of pages | 10 |
Publisher | Association for Computing Machinery |
Publication date | 2011 |
Pages | 41-50 |
ISBN (Print) | 978-1-4503-0555-6 |
DOIs | |
Publication status | Published - 2011 |
Event | 2011 SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems - Chicago, United States Duration: 11 Apr 2011 → 14 Feb 2012 |
Conference
Conference | 2011 SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems |
---|---|
Country/Territory | United States |
City | Chicago |
Period | 11/04/2011 → 14/02/2012 |