Investigating preprocessor-based syntax errors

  • Authors:
  • Flávio Medeiros;Márcio Ribeiro;Rohit Gheyi

  • Affiliations:
  • Federal University of Campina Grande, Campina Grande, Brazil;Federal University of Alagoas, Maceió, Brazil;Federal University of Campina Grande, Campina Grande, Brazil

  • Venue:
  • Proceedings of the 12th international conference on Generative programming: concepts & experiences
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The C preprocessor is commonly used to implement variability in program families. Despite the widespread usage, some studies indicate that the C preprocessor makes variability implementation difficult and error-prone. However, we still lack studies to investigate preprocessor-based syntax errors and quantify to what extent they occur in practice. In this paper, we define a technique based on a variability-aware parser to find syntax errors in releases and commits of program families. To investigate these errors, we perform an empirical study where we use our technique in 41 program family releases, and more than 51 thousand commits of 8 program families. We find 7 and 20 syntax errors in releases and commits of program families, respectively. They are related not only to incomplete annotations, but also to complete ones. We submit 8 patches to fix errors that developers have not fixed yet, and they accept 75% of them. Our results reveal that the time developers need to fix the errors varies from days to years in family repositories. We detect errors even in releases of well-known and widely used program families, such as Bash, CVS and Vim. We also classify the syntax errors into 6 different categories. This classification may guide developers to avoid them during development.