microsoft/checkedc
FreeChecked C is an extension to C that lets programmers write C code that is guaranteed by the compiler to be type-safe. The goal is to let people easily make their existing C code type-safe and eliminate entire classes of errors. Checked C does not address use-after-free errors. This repo has a wiki
About microsoft/checkedc
Checked C is an open-source extension to the C programming language that adds bounds checking and improved type safety. Developed by Microsoft, it allows programmers to retrofit existing C code to be memory-safe by enforcing static and dynamic checks on pointer bounds and array accesses. The project includes a modified Clang compiler (fork of LLVM/Clang) that implements the extension, along with a specification, sample code, test suites, and a semi-automated conversion tool called 3C. Checked C does not address use-after-free errors, but additional research (e.g., Fat Pointers for temporal memory safety) has explored extending it further. The project has been presented at academic conferences and is actively maintained on GitHub.
Key Features
Pros & Cons
- Compiler-enforced safety catches many common C errors at compile or runtime
- Incremental approach allows mixing checked and unchecked code
- Open source and free to use
- Backed by Microsoft and academic publications (IEEE, OOPSLA, etc.)
- Includes a formal specification and a conversion tool to ease adoption
- Does not address use-after-free errors (temporal memory safety)
- Requires a modified compiler (Clang fork) not yet merged into mainline LLVM
- May introduce runtime overhead due to bounds checks
- Limited adoption outside of research and Microsoft projects
- Learning curve for developers unfamiliar with the extension syntax