checkedc
checkedc copied to clipboard
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 elimina...
The result of putting a bounds-safe interface on the following code: ``` typedef struct foo { //... HANDLE h; // HANDLE is defined as typedef struct S* HANDLE //... }...
The return value for strchr should have **EDIT the same bounds as the input string** in its bounds-safe interface. Right now the bounds-safe interface has an interface type but no...
Hi, I have the following code: ``` typedef struct { ptr a; ptr b; } STRUCT; void break(void) { char temp checked[1000]; ptr s = NULL; s = dynamic_bounds_cast (&temp[20]);...
Hi, I am trying to compile a function using checkedC, however, i keep getting the missing prototype error. ``` /home/arslan/zephyrproject/zephyr/samples/hello_world/src/main.c:13:1: error: function without a prototype cannot be used or declared...
[This page](https://github.com/microsoft/checkedc/wiki/Proposed-extension-changes-to-improve-backward-compatibility) proposes a set of changes to the Checked C extension to improve backward compatibility. Creating this issue to track review/suggestions/updates to this proposal.
In `stdlib_checked.h` the function `calloc` is defined thus: ``` extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr) byte_count(nmemb * size); ``` but this type fails to recognize that since...
We started seeing an error in the 3C benchmark tests when we turned on implicit checked header inclusion (#440 and microsoft/checkedc-clang#998). Our icecast benchmark contains the equivalent of the following:...
Consider the following program: ```C #include #include #include #pragma CHECKED_SCOPE ON int main(int argc, nt_array_ptr argv checked[] : count(argc)) { nt_array_ptr str = "hello"; // forget the precise bound information...
The checked declaration of `bsearch` is: https://github.com/microsoft/checkedc/blob/4e6e0e489a57a68b1c8ad19b6d07a6797f286cbe/include/stdlib_checked.h#L90-L95 The caller is supposed to pass `size = sizeof(T)`, but nothing in the checked declaration expresses this constraint. If the `size` parameter is...
Section 2.6 of the Checked C specification states: > For heap-allocated data that contains checked pointers that may be used to access memory, the data must be zero-initialized by the...