checkedc/checkedc logo

checkedc/checkedc

Free

Checked C is an extension to C that lets programmers write C code with bounds checking and improved type-safety. The goal is to let people easily make their existing C code type-safe and eliminate entire classes of errors.

FreeFree tier
Type
Open Source

About checkedc/checkedc

Checked C is an open-source extension to the C programming language that adds bounds checking and improved type safety to help programmers retrofit existing C code for enhanced security. Developed as a fork of LLVM/clang, Checked C provides a specification, compiler releases for Windows, macOS, and Ubuntu, sample code, and test code. Key innovations include checked pointers, array pointers with bounds annotations, and fat pointers for temporal memory safety. The project also features a semi-automated conversion tool called 3C (C to Checked C by 3C) that assists in transforming legacy C code. Checked C has been formally modeled and published in academic venues, with ongoing research into temporal safety and incremental adoption strategies.

Key Features

Bounds checking for pointers and arrays
Improved type safety through checked pointer types
Semi-automated conversion tool (3C) for retrofitting legacy C code
Fat pointers providing temporal memory safety (research extension)
Formal model verified with Coq theorem prover
Compiler fork of LLVM/clang with available binaries for Windows, macOS, and Ubuntu
Comprehensive specification and sample code repository
Open-source and publicly developed on GitHub

Pros & Cons

Pros
  • Open-source and free to use
  • Integrates seamlessly with the LLVM/clang ecosystem
  • Provides both static and dynamic checking for bounds violations
  • Semi-automated conversion tool reduces migration effort
  • Active research community with published papers and ongoing development
  • Supports incremental adoption – can be applied to parts of a codebase
Cons
  • Requires manual annotation in some places, especially for complex pointer usage
  • Limited industrial adoption compared to other memory-safe approaches (e.g., Rust)
  • Learning curve for programmers unfamiliar with the type system extensions
  • Compiler fork may lag behind mainline LLVM/clang updates
  • Not a full rewrite – legacy code may still contain unchecked regions

Best For

Hardening existing C codebases against memory corruption vulnerabilitiesSafety-critical systems development (e.g., embedded, automotive, aerospace)Academic research in memory safety and programming languagesTeaching concepts of type safety and secure coding in CGradual adoption of memory-safe C in large projects

FAQ

What is Checked C?
Checked C is an extension to the C programming language that adds bounds checking and improved type safety. It is designed to help programmers retrofit existing C code to be more secure, and it includes a compiler, specification, and tools.
Is Checked C production-ready?
Checked C is an active research project with available compiler releases. While it can be used for exploration and hardening, its adoption in production systems is still limited. The project provides binaries and a specification, but users should evaluate its maturity for their specific needs.
How do I get started with Checked C?
You can download compiler releases from the Checked C GitHub repository. The Wiki provides a quick overview and pointers to sample code. The specification and build instructions are also available on the repository.
Does Checked C support temporal memory safety?
Yes, the project includes research on 'Fat Pointers For Temporal Memory Safety of C', which extends Checked C to provide temporal safety guarantees. This is described in a paper presented at OOPSLA 2023.
Can I use Checked C on existing C projects?
Yes, Checked C is designed for retrofitting existing C code. The semi-automated 3C tool helps convert code to use checked pointers and annotations, allowing incremental adoption. However, manual effort may still be required for complex patterns.