C/C++ conditional compilation analysis using symbolic execution
Ying Hu, Merlo, Dagenais et al. · International Conference on Software Maintenance · 2000
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 the 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.
Cited by 35 works. doi:10.1109/icsm.2000.883045
Authors
References
- Compilers: Principles, Techniques, and Tools
- On the inference of configuration structures from source code
- #ifdef Considered Harmful, or Portability Experience With C News
- On the inference of configuration structures from source code
- Incl: A Tool to Analyze Include Files
- Understanding code containing preprocessor constructs
- Preprocessors from an abstract point of view
- Software engineering — a European perspective
- Portability and the C Language
- Preprocessors from an abstract point of view