Skip to content

Include rel_align clause when checking syntactic equality of bounds declarations #326

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

Open
dtarditi opened this issue Jun 20, 2017 · 0 comments
Labels
work item This labels issues that are not exactly bugs but are about improvements.

Comments

@dtarditi
Copy link
Member

When programmers redeclare functions with parameters or returns that have bounds declarations, we check that the bounds declarations are syntactically equal (modulo variable names). We need to make sure that the relative alignment clause is included in the check.

This work item has two parts:

  • Make sure that the relative alignment clause is included in the check of equality of bounds. This is implement in lib\AST\StmtProfile.cpp. The function for Visit*BoundsExpr need to be extend to include the relative alignment information.
  • Add tests to the Checked C repo in tests\typechecking\redeclarations.c for this functionality.
@dtarditi dtarditi added the work item This labels issues that are not exactly bugs but are about improvements. label Jun 20, 2017
dopelsunce pushed a commit to dopelsunce/checkedc-clang that referenced this issue Sep 28, 2020
By default, checked scopes will include compile-time checks to prevent type
confusion.  The checks will restrict pointer casts, for example. If a
programmer wants only checks for bounds safety, a programmer can modify a
checked scope using the _Bounds_only modifier:

checked bounds_only { ... }

This change adds tests of checked scopes with the new bounds_only modifier.
We haven't implemented the restrictions on pointer casts yet, so the tests
check only that checked scopes with bounds_only modifiers implement the same
restrictions that regular checked scopes currently do.

The change parameterizes checked_scope_basic.c by a #define that adds
a scope modifier optionally.  We create a dummy file to compile the alternate
version of the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work item This labels issues that are not exactly bugs but are about improvements.
Projects
None yet
Development

No branches or pull requests

1 participant