Checked 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 for Checked C, sample code, the specification, and test code.
This is a minor update to the Checked C specification released on September 14th, 2021.
realloc
.This is a minor update to the Checked C specification that brings it into agreement with the compiler implementation.
This is a minor update to the Checked C specification that brings it into agreement with the compiler implementation.
bounds_cast
expressions. Remove the old syntax where the kind of bounds expression was inferred based on the number of arguments. Now the target bounds expression is an additional argument.The main improvement in Version 0.7 is adding support for checked strings and checked pointers to null-terminated arrays.
The improvements and changes include:
nt_checked
) and checked pointers to null-terminated arrays (nt_array_ptr
)bounds(none)
to bounds(unknown)
.array_ptrs
of function types.Caveats:
A non-null value at the upper bound an nt_array_ptr
allows the bounds of the nt_array_ptr
to be widened. The flow analysis for widening bounds still needs to be described in detail.
The improvements in Version 0.6 include:
Chapter 3 (bounds for variables) has been revised to be easier to follow. Sections have been reordered to follow more logically and advanced material that can be skipped has been moved to the end of the chapter.
Version 0.5 of the Checked C Specification