spec: minimal documention of unsafe.Pointer conversions
Per suggestion from rsc as a result of the dicussion of (abandoned) CL 153110044. Fixes #7192. LGTM=r, rsc, iant R=r, rsc, iant, ken CC=golang-codereviews https://golang.org/cl/163050043
This commit is contained in:
parent
b51123001f
commit
5361b747b7
@ -1,6 +1,6 @@
|
|||||||
<!--{
|
<!--{
|
||||||
"Title": "The Go Programming Language Specification",
|
"Title": "The Go Programming Language Specification",
|
||||||
"Subtitle": "Version of October 16, 2014",
|
"Subtitle": "Version of October 23, 2014",
|
||||||
"Path": "/ref/spec"
|
"Path": "/ref/spec"
|
||||||
}-->
|
}-->
|
||||||
|
|
||||||
@ -6207,8 +6207,8 @@ type Error interface {
|
|||||||
The built-in package <code>unsafe</code>, known to the compiler,
|
The built-in package <code>unsafe</code>, known to the compiler,
|
||||||
provides facilities for low-level programming including operations
|
provides facilities for low-level programming including operations
|
||||||
that violate the type system. A package using <code>unsafe</code>
|
that violate the type system. A package using <code>unsafe</code>
|
||||||
must be vetted manually for type safety. The package provides the
|
must be vetted manually for type safety and may not be portable.
|
||||||
following interface:
|
The package provides the following interface:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre class="grammar">
|
<pre class="grammar">
|
||||||
@ -6223,10 +6223,11 @@ func Sizeof(variable ArbitraryType) uintptr
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
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 <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
|
||||||
|
a <code>Pointer</code> type and vice versa.
|
||||||
|
The effect of converting between <code>Pointer</code> and <code>uintptr</code> is implementation-defined.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user