Commit 86f5f7fd authored by Robert Griesemer's avatar Robert Griesemer

spec: clarify unsafe.Pointer conversions

A pointer type of underlying type unsafe.Pointer can be used in
unsafe conversions. Document unfortunate status quo.

Fixes #19306.

Change-Id: I28172508a200561f8df366bbf2c2807ef3b48c97
Reviewed-on: https://go-review.googlesource.com/42132Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 54102963
<!--{ <!--{
"Title": "The Go Programming Language Specification", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of May 3, 2017", "Subtitle": "Version of May 9, 2017",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
...@@ -6431,7 +6431,7 @@ func Sizeof(variable ArbitraryType) uintptr ...@@ -6431,7 +6431,7 @@ func Sizeof(variable ArbitraryType) uintptr
A <code>Pointer</code> is a <a href="#Pointer_types">pointer type</a> but a <code>Pointer</code> A <code>Pointer</code> is a <a href="#Pointer_types">pointer type</a> but a <code>Pointer</code>
value may not be <a href="#Address_operators">dereferenced</a>. value may not be <a href="#Address_operators">dereferenced</a>.
Any pointer or value of <a href="#Types">underlying type</a> <code>uintptr</code> can be converted to Any pointer or value of <a href="#Types">underlying type</a> <code>uintptr</code> can be converted to
a <code>Pointer</code> type and vice versa. a type of underlying type <code>Pointer</code> and vice versa.
The effect of converting between <code>Pointer</code> and <code>uintptr</code> is implementation-defined. The effect of converting between <code>Pointer</code> and <code>uintptr</code> is implementation-defined.
</p> </p>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment