Preprint Article Version 1 Preserved in Portico This version is not peer-reviewed

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

Version 1 : Received: 31 October 2023 / Approved: 1 November 2023 / Online: 2 November 2023 (06:57:58 CET)

A peer-reviewed article of this Preprint also exists.

DeLozier, C. How Close Is Existing C/C++ Code to a Safe Subset? J. Cybersecur. Priv. 2024, 4, 1-22. DeLozier, C. How Close Is Existing C/C++ Code to a Safe Subset? J. Cybersecur. Priv. 2024, 4, 1-22.

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++ standards and safe C++ subsets. We analyze the code characteristics of 5.8 million code samples from the Exebench benchmark suite and 5 modern C++ applications using a static analysis tool. We find that raw pointers, unsafe casts, and unsafe library functions are used in both C++ code at large and modern C++ applications. In general, 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++.

Keywords

programming languages; safe subset; memory safety; C++

Subject

Computer Science and Mathematics, Computer Science

Comments (0)

We encourage comments and feedback from a broad range of readers. See criteria for comments and our Diversity statement.

Leave a public comment
Send a private comment to the author(s)
* All users must log in before leaving a comment
Views 0
Downloads 0
Comments 0
Metrics 0


×
Alerts
Notify me about updates to this article or when a peer-reviewed version is published.
We use cookies on our website to ensure you get the best experience.
Read more about our cookies here.