]> Cypherpunks repositories - gostls13.git/commitdiff
spec: unsafe.Pointers are pointers
authorRobert Griesemer <gri@golang.org>
Mon, 7 Oct 2013 17:43:28 +0000 (10:43 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 7 Oct 2013 17:43:28 +0000 (10:43 -0700)
But they cannot be dereferenced.
See also issue 6116.

Fixes #6358.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/14374046

doc/go_spec.html

index 3d1189973d177ee18c13ab2c74e3b74526ec9cb7..4ed5f4d1751902c53ce717e5dfd8588c4417a9a2 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of Oct 3, 2013",
+       "Subtitle": "Version of Oct 7, 2013",
        "Path": "/ref/spec"
 }-->
 
@@ -5954,6 +5954,8 @@ func Sizeof(variable ArbitraryType) uintptr
 <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>
+value may not be <a href="#Address_operators">dereferenced</a>.
 </p>
 
 <pre>
@@ -5962,6 +5964,8 @@ bits = *(*uint64)(unsafe.Pointer(&amp;f))
 
 type ptr unsafe.Pointer
 bits = *(*uint64)(ptr(&amp;f))
+
+var p ptr = nil
 </pre>
 
 <p>