TypeChef: toward type checking #ifdef variability in C

  • Authors:
  • Andy Kenner;Christian Kästner;Steffen Haase;Thomas Leich

  • Affiliations:
  • Metop Research GmbH, Magdeburg, Germany;Philipps University Marburg, Marburg, Germany;Metop Research GmbH, Magdeburg, Germany;Metop Research GmbH, Magdeburg, Germany

  • Venue:
  • FOSD '10 Proceedings of the 2nd International Workshop on Feature-Oriented Software Development
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Software product lines have gained momentum as an approach to generate many variants of a program, each tailored to a specific use case, from a common code base. However, the implementation of product lines raises new challenges, as potentially millions of program variants are developed in parallel. In prior work, we and others have developed product-line-aware type systems to detect type errors in a product line, without generating all variants. With TypeChef, we build a similar type checker for product lines written in C that implements variability with #ifdef directives of the C preprocessor. However, a product-line-aware type system for C is more difficult than expected due to several peculiarities of the preprocessor, including lexical macros and unrestricted use of #ifdef directives. In this paper, we describe the problems faced and our progress to solve them with TypeChef. Although TypeChef is still under development and cannot yet process arbitrary C code, we demonstrate its capabilities so far with a case study: By type checking the open-source web server Boa with potentially 2110 variants, we found type errors in several variants.