-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
gccgo: cannot convert user-defined type whose underlying type is uintptr to unsafe.Pointer #10284
Labels
Comments
/cc @ianlancetaylor for gccgo |
see a mention of something similar conformal/gotk3#58 (comment) |
strange, this works
|
gccgo implements the conversion to unsafe.Pointer wrong (or based on a
previous version of the spec?)
The spec says: "Any pointer or value of underlying type uintptr can be
converted to a Pointer type and vice versa." however, gccgo only allows
conversion to unsafe.Pointer if the type is uintptr.
Simple reproduction:
package f
import "unsafe"
type T uintptr
var x unsafe.Pointer = unsafe.Pointer(T(0))
|
minux
changed the title
gccgo cannot use type uintptr as type unsafe.Pointer
gccgo: cannot convert user-defined type whose underlying type is uintptr to unsafe.Pointer
Mar 30, 2015
Fixed on tip. |
marxin
pushed a commit
to marxin/gccold
that referenced
this issue
Mar 30, 2015
Any type whose underlying type is uintptr can be converted to unsafe.Pointer, and vice versa. Fixes golang/go#10284. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221774 138bc75d-0d04-0410-961f-82ee72b054a4
ianlancetaylor
pushed a commit
to golang/gofrontend
that referenced
this issue
Jun 2, 2015
Any type whose underlying type is uintptr can be converted to unsafe.Pointer, and vice versa. Fixes golang/go#10284. LGTM=iant R=iant CC=gofrontend-dev https://golang.org/cl/220480043
asiekierka
pushed a commit
to WonderfulToolchain/gcc-ia16
that referenced
this issue
May 16, 2022
Any type whose underlying type is uintptr can be converted to unsafe.Pointer, and vice versa. Fixes golang/go#10284. From-SVN: r221774
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This example from the go core runtime , trying to compile with
See code here on play :
http://play.golang.org/p/HkMAa-VU0x
The text was updated successfully, but these errors were encountered: