将 C++11 代码转换为 C++03 以支持遗留编译环境
Transforming C++11 Code to C++03 to Support Legacy Compilation Environments
AI总结:
本文提出一个源代码转换框架,可将 C++11 代码自动向后移植为功能等价的 C++03,并在工业与开源代码库上验证。
摘要:
较新的技术——编程语言、环境和库——变化非常迅速。然而,各种内部和外部约束往往使项目无法快速适应这些变化。例如,客户可能要求软件供应商具备特定的平台兼容性。在本工作中,我们在 C++ 编程语言的背景下处理这样一个问题。我们的工业合作伙伴需要使用仅支持较旧 C++ 语言版本的 SDK。但他们又希望允许开发人员在代码中使用最新的语言构造。为了解决这一问题,我们创建了一个源代码转换框架,用于将按照 C++11 标准编写的源代码自动向后移植为功能等价的 C++03 变体。借助我们的框架,开发人员可以自由利用最新的语言特性,而生产代码仍然使用一组受限的可用语言构造进行构建。本文报告了转换引擎的技术细节,以及我们将其应用于两个大型工业代码库和四个开源系统的经验。我们的解决方案可免费获取并且是开源的。
英文摘要:
Newer technologies - programming languages, environments, libraries - change very rapidly. However, various internal and external constraints often prevent projects from quickly adopting to these changes. Customers may require specific platform compatibility from a software vendor, for example. In this work, we deal with such an issue in the context of the C++ programming language. Our industrial partner is required to use SDKs that support only older C++ language editions. They, however, would like to allow their developers to use the newest language constructs in their code. To address this problem, we created a source code transformation framework to automatically backport source code written according to the C++11 standard to its functionally equivalent C++03 variant. With our framework developers are free to exploit the latest language features, while production code is still built by using a restricted set of available language constructs. This paper reports on the technical details of the transformation engine, and our experiences in applying it on two large industrial code bases and four open-source systems. Our solution is freely available and open-source.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。