1、中文5200字,3000英文单词,15500英文字符Extensions to the C Programming Language for Enhanced Fault Detection DAVID W. FLATER AND YELENA YESHA, E. K. PARK Summary The acceptance of the C programming language by academia and industry is partially responsible for the software crisis'. The simple, trusting seman
2、tics of C mask many common faults, such as range violations, which would be detected and reported at run-time by programs coded in a robust language such as Ada. This needlessly complicates the debugging of C programs. Although the assert macro lets programmers add run-time consistency checks
3、to their programs, the number of instantiations of this macro needed to make a C program robust makes it highly unlikely that any programmer could correctly perform the task. We make some unobtrusive extensions to the C language which support the efficient detection of faults at run-time without red
4、ucing the readability of the source code. Examples of the extensions are automatic checking of error codes returned by library routines, constrained subtypes and detection of references to uninitialized and/or non-existent array elements. key words : C Reliability Range checking Error checking Intro
5、duction It has been written that C provides about 50-80 per cent of the facilities one would want from a programming language.1 One of the missing facilities is run-time error checking. Errors such as exceeded array bounds, out-of-range data values, and I/O exceptions, which are reliably trapped by
6、the code generated by most Pascal and Ada compilers, go completely undetected by the code generated by most C compilers. Incorrect pointer usage and references to uninitialized variables can sometimes be detected with separate tools for static analysis (lint), but static analysis cannot detect all of the most common programmer errors. C will continue to be used despite its limitations, not only because the choice of language is often forced by external constraints,2 but also because many people have become addicted to the wors