Journal: IPSI Transactions on Internet Research


Monaco Support for an Improved Exception Specification in C++

Authors: Endre Fulop Attila Gyen and Norbert Pataki


View PDF Cite this article

Abstract

Exception handling is a beneficial language construct in modern programming languages. However, C++’s type system does not really conform to these elements. As a consequence, developers have to pay attention to avoid mistakes because of the missing compiler support. Moreover, C++11 provides an approach in which exceptions appear in the function’s signature in an inverse manner compared to the earlier standards.
Static analysis is an approach in which we reason about a program based on the source with no execution of the analyzed code. It can be used for many purposes, for instance, finding bugs, refactoring the code, or measuring code complexity.
In this paper, we analyze how the older style exception specifications can be rejuvenated for modern idioms. Explicitly marking the functions as having a guaranteed exception-free execution is the primary way since C++11. We develop a static analyzer tool for providing hints for these specifications. We evaluate our method with the analysis of open-source projects.
Based on the previous evaluation, not using the strictest possible exception-specification is a problem that occurred in every analyzed project. We would like to assist developers in identifying instances of this problem by providing an integrated comprehension tool, that enables them to make use of the exception analysis results in an interactive way in their IDEs.


Keywords

C++, exception handling, static analysis, Clang, Microsoft Monaco


Published in: IPSI Transaction on Internet Research (Volume: 19, Issue: 1)
Publisher: IPSI, Belgrade

Date of Publication: January 1, 2023

Open Access: CC-BY-NC-ND
DOI: 10.58245/ipsi.tir.2301.05

Pages: 24 - 31

ISSN: 1820 - 4503



References

1. A. Molki, “A comparative review of exception handling in Ada 95, C++, and Java,” in EDULEARN10 Proceedings, ser. 2nd International Conference on Education and New Learning Technologies. IATED, 5–7 July, 2010 2010, pp. 2937–2941.

2. C. de Dinechin, “C++ exception handling,” IEEE Concurrency, vol. 8, no. 4, pp. 72–79, 2000.

3. E. Fulop, A. Gyen, and N. Pataki, “A framework for C++ excep- ´ tion handling assistance,” in Proceedings of the Ninth Workshop on Software Quality Analysis, Monitoring, Improvement, and Applications (SQAMIA), ser. CEUR Workshop Proceedings, Z. Budimac, Ed., no. 3237, 2022, pp. 4:1–4:13.

4. B. Stroustrup, The C++ Programming Language, 4th ed. AddisonWesley Professional, 2013.

5. G. Nagy and Z. Porkolab, “The effects of using exception handling on software complexity,” Studia Universitatis Babes¸-Bolyai, Informatica, vol. LIX, pp. 174–184, 2014.

6. I. Horton and P. Van Weert, Runtime Errors and Exceptions. Berkeley, CA: Apress, 2018, pp. 571–612. [Online]. Available: https://doi.org/10.1007/978-1-4842-3366-5 15.

7. W. Steingartner, M. A. M. Eldojali, D. Radakovic, and J. Dost ´ al, ´ “Software support for course in semantics of programming languages,” in 2017 IEEE 14th International Scientific Conference on Informatics, 2017, pp. 359–364.

8. E. Fulop, A. Gyen, and N. Pataki, “C++ source code rejuvenation for ´ an improved exception specification,” in 2022 IEEE 16th International Scientific Conference on Informatics, W. Steingartner, S. Korecko, and A. Szakal, Eds., 2022, pp. 94–99.

9. T. Brunner and Z. Porkolab, “Advanced code comprehension version control information,” IPSI Transactions on Internet Research, vol. 16, no. 2, pp. 47–54, 2020.

10. R. Torres, T. Ludwig, J. M. Kunkel, and M. F. Dolz, “Comparison of Clang abstract syntax trees using string kernels,” in 2018 International Conference on High Performance Computing & Simulation (HPCS), 2018, pp. 106–113

...

×

Endre Fulop

Faculty of Informatics Eotvos Lorand University Budapest, Hungary. E-mail: gamesh411@gmail.com, Orcid ID: 0000-0003-2677-3178

×

Attila Gyen

Faculty of Informatics Eotvos Lorand University Budapest, Hungary. E-mail: gyenattila@gmail.com

×

Norbert Pataki

Faculty of Informatics Eotvos Lorand University Budapest, Hungary. Orcid ID: 0000-0002-7519-3367

×

Cite this article

Fulop, Endre; Gyen, Attila; and Pataki, Norbert "Monaco Support for an Improved Exception Specification in C++", IPSI Transactions on Internet Research, vol. 19(1), 2023, pp. 24-31. https://doi.org/10.58245/ipsi.tir.2301.05