HomeFreeBSD

Use intptr_t when storing an integer in a pointer

Description

Use intptr_t when storing an integer in a pointer

Cast the integer type to (u)intptr_t before casting to "void *". In
CHERI C/C++ we warn on bare casts from integers to pointers to catch
attempts to create pointers our of thin air. We allow the warning to be
supressed with a suitable cast through (u)intptr_t.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Brooks Davis <brooks.davis@sri.com>
Closes #14131

Details

Provenance
brooksAuthored on Oct 27 2022, 10:28 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Nov 3 2022, 4:52 PM
Parents
rG877790001e74: recvd_props_mode: use a uintptr_t to stash nvlists
Branches
Unknown
Tags
Unknown

Event Timeline