Skip to main content

Service Layer for IDE Integration of C/C++ Preprocessor Related Analysis

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8583))

Abstract

Software development in C/C++ languages is tightly coupled with preprocessor directives. While the use of preprocessor constructs cannot be avoided, current IDE support for developers can still be improved. Early feedback from IDEs about misused macros or conditional compilation has positive effects on developer productivity and code quality as well. In this paper we introduce a service layer for the Visual Studio to make detailed preprocessor information accessible for any type of IDE extensions. The service layer is built upon our previous work on the analysis of directives. We wrap the analyzer tool and provide its functionality through an API. We present the public interface of the service and demonstrate the provided services through small plug-ins implemented using various extension mechanisms. These plug-ins work together to aid the daily work of developers in several ways. We provide (1) an editor extension through the Managed Extensibility Framework which provides macro highlighting within the source code editor; (2) detailed information about actual macro substitutions and an alternative code view to show the results of macro calls; (3) a managed package for discovering the intermediate steps of macro replacements through a macro explorer. The purpose of this work is twofold: we present an additional layer designed to aid the work of tool developers; second, we provide directly usable IDE components to express its potentials.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Adams, B., De Meuter, W., Tromp, H., Hassan, A.E.: Can we refactor conditional compilation into aspects? In: AOSD 2009: Proceedings of the 8th ACM International Conference on Aspect-Oriented Software Development, pp. 243–254. ACM, New York (2009)

    Google Scholar 

  2. Ebert, J., Kullbach, B., Riediger, V., Winter, A.: GUPRO - Generic Understanding of Programs. In: Mens, T., Schürr, A., Taentzer, G. (eds.) Electronic Notes in Theoretical Computer Science, vol. 72, Elsevier (2002)

    Google Scholar 

  3. Ernst, M.D., Badros, G.J., Notkin, D.: An empirical analysis of C preprocessor use. IEEE Transactions on Software Engineering 28(12) (December 2002)

    Google Scholar 

  4. Feigenspan, J., Kästner, C., Apel, S., Liebig, J., Schulze, M., Dachselt, R., Papendieck, M., Leich, T., Saake, G.: Do background colors improve program comprehension in the #ifdef hell? Empirical Software Engineering 18(4), 699–745 (2013)

    Article  Google Scholar 

  5. Garrido, A., Johnson, R.: Analyzing multiple configurations of a c program. In: Proceedings of the 21st International Conference on Software Maintenance (ICSM 2005), pp. 379–388. IEEE Computer Society (2005)

    Google Scholar 

  6. Garrido, A., Johnson, R.: Embracing the c preprocessor during refactoring. Journal of Software: Evolution and Process 25(12), 1285–1304 (2013)

    Google Scholar 

  7. Krone, M., Snelting, G.: On the inference of configuration structures from source code. In: Proceedings of ICSE 1994, 16th International Conference on Software Engineering, pp. 49–57. IEEE Computer Society (1994)

    Google Scholar 

  8. Kullbach, B., Riediger, V.: Folding: An Approach to Enable Program Understanding of Preprocessed Languages. In: Proceedings of the 8th Working Conference on Reverse Engineering (WCRE 2001), pp. 3–12. IEEE Computer Society (2001)

    Google Scholar 

  9. Latendresse, M.: Fast symbolic evaluation of C/C++ preprocessing using conditional values. In: Proceedings of the 7th European Conference on Software Maintenance and Reengineering (CSMR 2003), pp. 170–179. IEEE Computer Society (March 2003)

    Google Scholar 

  10. Latendresse, M.: Rewrite systems for symbolic evaluation of c-like preprocessing. In: Proceedings of the 8th European Conference on Software Maintenance and Reengineering (CSMR 2004), pp. 165–173. IEEE Computer Society (March 2004)

    Google Scholar 

  11. Liebig, J., Apel, S., Lengauer, C., Kästner, C., Schulze, M.: An analysis of the variability in forty preprocessor-based software product lines. In: Proceedings of the 32Nd ACM/IEEE International Conference on Software Engineering, ICSE 2010, vol. 1, pp. 105–114. ACM, New York (2010)

    Google Scholar 

  12. Livadas, P., Small, D.: Understanding code containing preprocessor constructs. In: Proceedings of IWPC 1994, Third IEEE Workshop on Program Comprehension, pp. 89–97 (November 1994)

    Google Scholar 

  13. Mennie, C.A., Clarke, C.L.A.: Giving meaning to macros. In: Proceedings of IWPC 2004, pp. 79–88. IEEE Computer Society (2004)

    Google Scholar 

  14. Microsoft Visual Studio (2014), http://www.microsoft.com/visualstudio/

  15. Saebjoernsen, A., Jiang, L., Quinlan, D.J., Su, Z.: Static validation of c preprocessor macros. In: AOSD 2009: Proceedings of the 8th ACM International Conference on Aspect-Oriented Software Development, pp. 149–160. IEEE Computer Society (2009)

    Google Scholar 

  16. Singh, N., Gibbs, C., Coady, Y.: C-clr: a tool for navigating highly configurable system software. In: ACP4IS 2007: Proceedings of the 6th Workshop on Aspects, Components, and Patterns for Infrastructure Software, p. 9. ACM, New York (2007)

    Google Scholar 

  17. Spencer, H., Collyer, G.: #ifdef considered harmful, or portability experience with C News. In: USENIX Summer Technical Conference, pp. 185–197 (June 1992)

    Google Scholar 

  18. Spinellis, D.: A refactoring browser for c. In: ECOOP 2008 International Workshop on Advanced Software Development Tools and Techniques (WASDeTT) (2008)

    Google Scholar 

  19. Spinellis, D.: Optimizing header file include directives. Journal of Software Maintenance and Evolution: Research and Practice 22 (2010)

    Google Scholar 

  20. Sutton, A., Maletic, J.I.: How we manage portability and configuration with the c preprocessor. In: Proceedings of the 23rd International Conference on Software Maintenance (ICSM 2007), pp. 275–284 (2007)

    Google Scholar 

  21. Understand for C++ homepage (2009), http://www.scitools.com

  22. Vidács, L., Beszédes, A., Ferenc, R.: Columbus Schema for C/C++ Preprocessing. In: Proceedings of CSMR 2004 (8th European Conference on Software Maintenance and Reengineering), pp. 75–84. IEEE Computer Society (March 2004)

    Google Scholar 

  23. Vidács, L., Beszédes, A., Ferenc, R.: Macro impact analysis using macro slicing. In: Proceedings of ICSOFT 2007, The 2nd International Conference on Software and Data Technologies, pp. 230–235 (July 2007)

    Google Scholar 

  24. Vidács, L., Beszédes, Á., Gyimóthy, T.: Combining Preprocessor Slicing with C/C++ Language Slicing. Science of Computer Programming 74(7), 399–413 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  25. Vidács, L., Dévai, R., Ferenc, R., Gyimóthy, T.: Developer Support for Understanding Preprocessor Macro Expansions. In: Kim, T.-h., Ramos, C., Kim, H.-k., Kiumi, A., Mohammed, S., Ślęzak, D. (eds.) ASEA/DRBC 2012. CCIS, vol. 340, pp. 121–130. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  26. Vittek, M.: Refactoring browser with preprocessor. In: Proceedings of the Seventh European Conference on Software Maintenance and Reengineering (CSMR 2003), Benevento, Italy, pp. 101–110 (March 2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Dévai, R., Vidács, L., Ferenc, R., Gyimóthy, T. (2014). Service Layer for IDE Integration of C/C++ Preprocessor Related Analysis. In: Murgante, B., et al. Computational Science and Its Applications – ICCSA 2014. ICCSA 2014. Lecture Notes in Computer Science, vol 8583. Springer, Cham. https://doi.org/10.1007/978-3-319-09156-3_29

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-09156-3_29

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-09155-6

  • Online ISBN: 978-3-319-09156-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics