Checkmate
Authors:
Open Access
- 1 March 2000
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGCSE Bulletin
- Vol. 32 (1) , 352-356
Abstract
Pointer errors are stumbling blocks for student and veteran programmers alike. Although languages such as Java use references to protect programmers from pointer pitfalls, the use of garbage collection dictates that languages like C++ will still be used for real-time mission-critical applications. Pointers will stay in the classroom as long as they're used in industry, so as educators, we must find better ways to teach them. This paper presents checked pointers , a simple wrapper for C++ pointers that prevents pointer arithmetic and other common sources of pointer errors, and detects all dereferencing and deallocation errors, including memory leaks. The syntax of checked pointers is highly faithful to raw C++ pointers, but provides run-time error detection and debugging information. After debugging, changing one #include is all that is required to substitute a non-checking implementation that is as fast as raw C++.Keywords
This publication has 2 references indexed in Scilit:
- Static detection of dynamic memory errors1996
- Copying and swapping: influences on the design of reusable software componentsIEEE Transactions on Software Engineering, 1991