The Community for Technology Leaders
2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation (2011)
Williamsburg, Virginia USA
Sept. 25, 2011 to Sept. 26, 2011
ISBN: 978-0-7695-4347-5
pp: 115-124
The C preprocessor cpp is a powerful and language-independent tool, widely used to implement variable software in different programming languages (C, C++) using conditional compilation. Preprocessor annotations can used on different levels of granularity such as functions or statements. In this paper, we investigate whether there is a relation between code clones and preprocessor annotations. Specifically, we address the question whether the discipline of annotation has an effect on code clones. To this end, we perform a case study on fifteen different C programs and analyze them regarding code clones and #ifdef occurrences. We found only minor effects of annotations on code clones, but a relationship between annotations that align with the code structure (and code clones). With this work, we provide new insights why code clones occur in C programs. Furthermore, the results can support the decision whether or not it is beneficial to remove clones.
C preprocessor, code clones, empirical study, software maintenance

J. Feigenspan, S. Schulze and E. Jürgens, "Analyzing the Effect of Preprocessor Annotations on Code Clones," 2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation(SCAM), Williamsburg, Virginia USA, 2011, pp. 115-124.
102 ms
(Ver 3.3 (11022016))