{"title":"c++中对改进的异常规范的支持","authors":"Endre Fulop, Attila Gyen, Norbert Pataki","doi":"10.58245/ipsi.tir.2301.05","DOIUrl":null,"url":null,"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.","PeriodicalId":41192,"journal":{"name":"IPSI BgD Transactions on Internet Research","volume":"38 1","pages":""},"PeriodicalIF":0.4000,"publicationDate":"2023-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"Monaco Support for an Improved Exception Specification in C++\",\"authors\":\"Endre Fulop, Attila Gyen, Norbert Pataki\",\"doi\":\"10.58245/ipsi.tir.2301.05\",\"DOIUrl\":null,\"url\":null,\"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.\",\"PeriodicalId\":41192,\"journal\":{\"name\":\"IPSI BgD Transactions on Internet Research\",\"volume\":\"38 1\",\"pages\":\"\"},\"PeriodicalIF\":0.4000,\"publicationDate\":\"2023-01-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"1\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"IPSI BgD Transactions on Internet Research\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.58245/ipsi.tir.2301.05\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, INFORMATION SYSTEMS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"IPSI BgD Transactions on Internet Research","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.58245/ipsi.tir.2301.05","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
Monaco Support for an Improved Exception Specification in C++
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.