A type system for static and dynamic checking of C++ pointers

  • Authors:
  • Giuseppe Della Penna

  • Affiliations:
  • Dipartimento di Informatica, Universití degli Studi di L'Aquila, Via Vetoio, I-67100 L'Aquila, Italy

  • Venue:
  • Computer Languages, Systems and Structures
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

Object-oriented programming is the most used programming paradigm when dealing with large-scale, modular software. In this field, the two leading languages are Java and C++. The former has superior qualities in terms of safety and ease of programming, whereas the latter is often considered an ''old'' language, too complex and potentially unsafe. In this paper, we describe a new type system designed to analyze the security problems derived from pointer manipulation in C++. This type system tries to trap the most common errors through static analysis, i.e., at compile-time, and only when static analysis fails it generates and embeds code fragments that apply runtime checks on specific instructions. The aim of this new type system is to give C++ the same safety of Java in the most important memory-related operations, without adding much runtime overhead. An experimental implementation of the type system is also presented, embedded in a C++ analysis tool called GPCC.