Clarify (un)signed-ness of pointers for comparisons #77497
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
A-raw-pointers
Area: raw pointers, MaybeUninit, NonNull
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
It seems currently pointer comparisons, ala.
(foo as *const u32) > (bar as *const u32)
. Emits an unsigned comparison. I looked a little bit to see if this was documented somewhere and I didn't see anything super obvious.Is this something that is defined behavior, and if it is, could we clarify it in the primitive
pointer
type documentation? This can be relevant especially in many kernel designs when there are "negative" addresses in the kernel and "positive" in user-space.Thanks!
-B
The text was updated successfully, but these errors were encountered: