]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use intptr_t when storing an integer in a pointer
authorBrooks Davis <brooks@one-eyed-alien.net>
Thu, 27 Oct 2022 22:28:03 +0000 (23:28 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 3 Nov 2022 16:52:23 +0000 (09:52 -0700)
commitb9041e1f27b7b29b27ac3b873c7ba2922bccca01
tree9373e5bd74abc3b07b31f18250ff67a079d2ea58
parent877790001e74b6c3b2955e4b7a8c685385e77654
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
cmd/zstream/zstream_decompress.c
module/zfs/zfs_vnops.c