Closed
Description
This issue was copied from checkedc/checkedc-clang#865
Fixes #855
This PR allows _Assume_bounds_casts to be used to convert an unchecked function pointer (including NULL
) to a checked function pointer. The unchecked function pointer pointee type must be compatible with the checked function pointer pointee type.
For example, this will be allowed:
void test(int(*f)(int)) {
ptr<int(int)> safe = _Assume_bounds_cast<ptr<int(int)>>(f);
}
This will not be allowed:
void test(int(*f)(int)) {
ptr<void(double)> bad = _Assume_bounds_cast<ptr<void(double)>>(f);
}
Testing:
- Added tests in checkedc/407
- Passed manual testing on Windows
- Passed automated testing on Windows/Linux
Metadata
Metadata
Assignees
Labels
No labels