How Close Is Existing C/C++ Code to a Safe Subset?

Author:

DeLozier Christian1ORCID

Affiliation:

1. United States Naval Academy, 105 Maryland Ave, Annapolis, MD 21402, USA

Abstract

Using a safe subset of C++ is a promising direction for increasing the safety of the programming language while maintaining its performance and productivity. In this paper, we examine how close existing C/C++ code is to conforming to a safe subset of C++. We examine the rules presented in existing safe C/C++ standards and safe C/C++ subsets. We analyze the code characteristics of 5.8 million code samples from the Exebench benchmark suite, two C/C++ benchmark suites, and five modern C++ applications using a static analysis tool. We find that raw pointers, unsafe casts, and unsafe library functions are used in both C/C++ code at large and in modern C++ applications. In general, C/C++ code at large does not differ much from modern C++ code, and continued work will be required to transition from existing C/C++ code to a safe subset of C++.

Publisher

MDPI AG

Subject

General Earth and Planetary Sciences,General Environmental Science

Reference35 articles.

1. (2023, July 27). National Vulnerability Database CWE Over Time, Available online: https://nvd.nist.gov/general/visualizations/vulnerability-visualizations/cwe-over-time.

2. (2023, July 27). National Security Agency Cybersecurity Information Sheet, Available online: https://media.defense.gov/2022/Nov/10/\2003112742/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY.PDF.

3. Biden, J. (2023, October 06). Executive Order on Improving the Nation’s Cybersecurity. The White House. 12 May 2021, Available online: https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/.

4. Hinnant, R., Orr, R., Stroustrup, B., Vandevoorde, D., and Wong, M. (2023). The C++ Standards Committee, ISO. Document Number P2759R0.

5. Austin, T.M., Breach, S.E., and Sohi, G.S. (1994, January 20–24). Efficient detection of all pointer and array access errors. Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation (PLDI ’94), Orlando, FL, USA.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3