checkedc / checkedc-fork

This was a fork of Checked C used from 2021-2024. The changes have been merged into the original Checked C repo.
Other
26 stars 3 forks source link

Check return value bounds: update tests #463

Closed secure-sw-dev-bot closed 2 years ago

secure-sw-dev-bot commented 2 years ago

This issue was copied from https://github.com/microsoft/checkedc/issues/465


This PR updates test files to account for the new compiler behavior in checkedc-clang/1150: checking that the inferred bounds of a return expression imply the declared bounds (if any) for the enclosing function.

The test updates fall into three different categories:

  1. Adding expected errors for functions with declared bounds that return a value with unknown bounds that were previously marked with TODOs. There were six errors of this kind: one in bounds_decl_checking.c and five in pointer_types.c.
  2. Adding expected errors for functions with declared bounds that return a value with unknown bounds that were not previously marked with TODOs. There were two errors of this kind: one in checked_scope_interfaces.c and one in interop_type_annotations.c
  3. Adding expected errors for return value bounds and declared function bounds that had free variables. There were five errors of this kind: all in bounds.c.