mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
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
This commit is contained in:
committed by
Brian Behlendorf
parent
877790001e
commit
b9041e1f27
@@ -146,7 +146,7 @@ zstream_do_decompress(int argc, char *argv[])
|
||||
p = hsearch(e, ENTER);
|
||||
if (p == NULL)
|
||||
errx(1, "hsearch");
|
||||
p->data = (void*)type;
|
||||
p->data = (void*)(intptr_t)type;
|
||||
}
|
||||
|
||||
if (isatty(STDIN_FILENO)) {
|
||||
|
||||
Reference in New Issue
Block a user