Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsafe: document if syscall.Syscall exemption to unsafe.Pointer rules also applies to other assembly functions #68301

Closed
DemiMarie opened this issue Jul 4, 2024 · 3 comments
Labels
Documentation NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@DemiMarie
Copy link
Contributor

Go version

1.22.5 (this is from pkg.go.dev)

Output of go env in your module/workspace:

N/A (this is from viewing the docs online on pkg.go.dev)

What did you do?

Looked at the docs for unsafe.Pointer

What did you see happen?

Point 4 in the list of allowed uses for unsafe.Pointer states:

Conversion of a Pointer to a uintptr when calling syscall.Syscall.

but the subsequent explanation implies that any function written in assembly can be used, including syscall.Syscall as a special case.

What did you expect to see?

Consistent documentation

@ianlancetaylor
Copy link
Member

A typical function written in assembler should know which parameters are pointers and which are not. syscall.Syscall is a special case because we don't want to have to write every possible variant. Still, I tweaked it to "functions like syscall.Syscall" in https://go.dev/cl/596936. Thanks.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/596936 mentions this issue: unsafe: say "functions like syscall.Syscall", not only Syscall

@cagedmantis cagedmantis added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 8, 2024
@seankhliao seankhliao added this to the Go1.23 milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants