Adding run‐time checking to the portable C compiler
- 1 April 1992
- journal article
- research article
- Published by Wiley in Software: Practice and Experience
- Vol. 22 (4) , 305-316
- https://doi.org/10.1002/spe.4380220403
Abstract
Run‐time checking of array subscripts and pointer bounds was added to the Portable C Compiler (PCC). Memory overwrite bugs are then caught as they happen instead of when the overwritten memory is used later in the program execution. The run‐time checking compiler is used both to find the true cause of a core dump and to eliminate run‐time errors as the cause of unexpected program behavior. On average, it takes about 40 percent longer to compile, the generated code is about three times larger, and it runs about ten times slower. This performance may seem slow, but it typically reduces days of debugging to less than an hour. The implementation described herein can be adapted to any C compiler as it describes how to generate run‐time checking code in a machine/compiler independent way by changing the intermediate expression trees. In four years of use it has found latent bugs and the cause of intermittent core dumps in programs used for many years by thousands of people.Keywords
This publication has 4 references indexed in Scilit:
- Experience with a portable debugging toolSoftware: Practice and Experience, 1984
- The Implementation of Run-Time Diagnostics in PascalIEEE Transactions on Software Engineering, 1980
- Economic range checks in pascalSoftware: Practice and Experience, 1978
- Error checking, tracing, and dumping in an ALGOL 68 checkout compilerACM SIGPLAN Notices, 1977