C/C++ Conditional Compilation Analysis Using Symbolic Execution

  • Authors:
  • Ying Hu;Ettore Merlo;Michel Dagenais;Bruno Lagüe

  • Affiliations:
  • -;-;-;-

  • Venue:
  • ICSM '00 Proceedings of the International Conference on Software Maintenance (ICSM'00)
  • Year:
  • 2000

Quantified Score

Hi-index 0.00

Visualization

Abstract

Conditional compilation is one of the most powerful parts of a C/C++ environment available for building software for different platforms with different feature sets. Although conditional compilation is powerful, it can be difficult to understand and is error prone. In large software systems, file inclusion, conditional compilation and macro substitution are closely related and are often largely interleaved. Without adequate tools, understanding complex header files is a tedious task. This practice may even be complicated as the hierarchies of header files grow with projects. This paper presents our experiences of studying conditional compilation based on symbolic execution of preprocessing directives. Our two concrete goals are: for any given preprocessor directive or C/C++ source code line, finding the simplest sufficient condition to reach/compile it, and finding the full condition to reach/compile that code line. Two different strategies were used to achieve these two goals. A series of experiments conducted on the Linux kernel are presented.