HomeFreeBSD

tip: Cast via intptr_t not long when casting between pointer and int

Description

tip: Cast via intptr_t not long when casting between pointer and int

Whilst all FreeBSD architectures have the same representation for
intptr_t and long (even if the former is int on ILP32 architectures),
this is more general and correct, and on CHERI they are not the same so
warnings are generated by default for integer-to-pointer casts that
aren't via (u)intptr_t.

Reviewed by: imp, kib
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D30696

Details

Provenance
jrtc27Authored on Jun 8 2021, 5:30 PM
Reviewer
imp
Differential Revision
D30696: tip: Cast via intptr_t not long when casting between pointer and int
Parents
rG9021c46603bf: tests/netgraph: Attribute errors to the caller
Branches
Unknown
Tags
Unknown