Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Silence harmless warnings on CHERI by using INT2PTR where appropriate
On CHERI, pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety. In order to ensure round trips via (u)intptr_t preserve this metadata, (u)intptr_t are themselves represented as capabilities, not plain integers. In order to catch programming errors caused by using an integer type other than those to hold a pointer, CHERI LLVM emits a warning by default whenever a plain integer is cast directly to a pointer (except for integer constants, so that idioms like (void *)-1 continue to work), since it is likely the source of that cast should have been a (u)intptr_t instead. Three instances of this warning remain when compiling for CHERI (note that Tcl_SetHashValue internally casts to void *), all of which are harmless; silence them by using INT2PTR.
- Loading branch information