How We Manage Portability and Configuration with the C Preprocessor

An in-depth investigation of C preprocessor usage for portability and configuration management is presented. Three heavily-ported and widely used C++ libraries are examined. A core set of header files responsible for configuration management is identified in each system. Then macro usage is extracted and analyzed both manually and with the help of program analysis tools. The configuration structure of each library is discussed in details and commonalities between the systems, including conventions and patterns are discussed. A common configuration architecture for managing portability concerns is derived and presented.

[1]  Gregor Snelting,et al.  Reengineering of configurations based on mathematical concept analysis , 1996, TSEM.

[2]  Rudolf Ferenc,et al.  Columbus schema for C/C++ preprocessing , 2004, Eighth European Conference on Software Maintenance and Reengineering, 2004. CSMR 2004. Proceedings..

[3]  Ralph E. Johnson,et al.  Refactoring C with conditional compilation , 2003, 18th IEEE International Conference on Automated Software Engineering, 2003. Proceedings..

[4]  Ira D. Baxter,et al.  Preprocessor conditional removal by simple partial evaluation , 2001, Proceedings Eighth Working Conference on Reverse Engineering.

[5]  Charles L. A. Clarke,et al.  Giving meaning to macros , 2004, Proceedings. 12th IEEE International Workshop on Program Comprehension, 2004..

[6]  Michel Dagenais,et al.  C/C++ conditional compilation analysis using symbolic execution , 2000, Proceedings 2000 International Conference on Software Maintenance.

[7]  Mario Latendresse Rewrite systems for symbolic evaluation of C-like preprocessing , 2004, Eighth European Conference on Software Maintenance and Reengineering, 2004. CSMR 2004. Proceedings..

[8]  Michael D. Ernst,et al.  An Empirical Analysis of C Preprocessor Use , 2002, IEEE Trans. Software Eng..

[9]  Jean-Marie Favre,et al.  Preprocessors from an abstract point of view , 1996, 1996 Proceedings of International Conference on Software Maintenance.

[10]  Marian Vittek Refactoring browser with preprocessor , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

[11]  Henry Spencer,et al.  #ifdef Considered Harmful, or Portability Experience with C News , 1992, USENIX Summer.

[12]  Andrian Marcus,et al.  Supporting document and data views of source code , 2002, DocEng '02.

[13]  Andrian Marcus,et al.  Source code files as structured documents , 2002, Proceedings 10th International Workshop on Program Comprehension.

[14]  Ralph E. Johnson,et al.  Analyzing multiple configurations of a C program , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[15]  David Lorge Parnas,et al.  Software aging , 1994, Proceedings of 16th International Conference on Software Engineering.

[16]  Jean-Marie Favre Understanding-in-the-large , 1997, Proceedings Fifth International Workshop on Program Comprehension. IWPC'97.

[17]  Gregor Snelting,et al.  On the inference of configuration structures from source code , 1994, Proceedings of 16th International Conference on Software Engineering.

[18]  Diomidis Spinellis,et al.  Global Analysis and Transformations in Preprocessed Languages , 2003, IEEE Trans. Software Eng..

[19]  David Notkin,et al.  A framework for preprocessor-aware C source code analyses , 2000, Softw. Pract. Exp..

[20]  Mario Latendresse Fast symbolic evaluation of C/C++ preprocessing using conditional values , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..