Fast Symbolic Evaluation of C/C++ Preprocessing Using Conditional Values

  • Authors:
  • Mario Latendresse

  • Affiliations:
  • -

  • Venue:
  • CSMR '03 Proceedings of the Seventh European Conference on Software Maintenance and Reengineering
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

C/C++ code relying on preprocessing can be quite complexto analyze. This is often due to free preprocessing variablesset at compile time. In general, preprocessing selectivelycompile parts of the source code based on the valuesof preprocessing variables which may be free. In thiscase, the relations between these parts can only be representedby conditional expressions using the free variables.Traditional symbolic evaluation can be used to infer theseexpressions, but its best case time complexity is exponential.We present a new approach for symbolic evaluation that canefficiently compute these conditions by binding variables toconditional values and avoiding the path feasibility analysisof traditional symbolic evaluation. It infers the exact conditionalexpressions for which the lines of code are compiledand the (conditional) values of preprocessing variables ateach point of the source code. Our prototype shows the approachas practical and scaleable to large C/C++ software.