Skip to content

Implement parsing and type checking for checked pointers to null-terminated arrays #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dtarditi opened this issue Sep 27, 2017 · 1 comment

Comments

@dtarditi
Copy link
Member

This is a work item for #215.

@dtarditi dtarditi changed the title Implementing parsing and type checking for checked pointers to null-terminated arrays Implement parsing and type checking for checked pointers to null-terminated arrays Sep 27, 2017
@dtarditi
Copy link
Member Author

This was completed by PR #394.

dopelsunce pushed a commit to dopelsunce/checkedc-clang that referenced this issue Sep 28, 2020
Test at run time that predefined identifiers actually work when assigned to checked ptrs.   Predefined identifiers are defined in Section 6.4.2.2 of the C11 Standard.  The special identifier __func__ evaluates to a string that is the name of the current function.   Add tests of assignment and subscripting of __func__.
sulekhark pushed a commit that referenced this issue Feb 27, 2021
Adds an edge PTR -> x for expressions &x. Previously, only the result
of the addrof expression had this constraint, but CheckedC prohibits
taking the address of pointers with bounds. It is possible to take the
address of an _Array_ptr when the pointer doesn't have bounds declared.
With this constraint added however, 3C will not let this happen.
sulekhark pushed a commit that referenced this issue Feb 27, 2021
CheckedC does let you take the address of constant size checked arrays. The
previous commit would not let this happen, causing the ptrtoconstarr.c
test to fail. It also caused ptrptr.c to fail, but this was because the
-alltypes behavior expected in that test generated code that did not
compile (because it took the address of an _Array_ptr). Both tests are
now passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant