Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
51338095
Commit
51338095
authored
Mar 08, 2013
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: clarify unsafe.Offsetof
Fixes #4905. R=rsc, r, iant, ken CC=golang-dev
https://golang.org/cl/7583043
parent
7663ffca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
go_spec.html
doc/go_spec.html
+5
-3
No files found.
doc/go_spec.html
View file @
51338095
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of March
4
, 2013",
"Subtitle": "Version of March
7
, 2013",
"Path": "/ref/spec"
}-->
...
...
@@ -5734,8 +5734,10 @@ as if <code>v</code> was declared via <code>var v = x</code>.
</p>
<p>
The function
<code>
Offsetof
</code>
takes a (possibly parenthesized)
<a
href=
"#Selectors"
>
selector
</a>
denoting a struct field of any type and returns the field offset in bytes relative to the
struct's address.
<code>
s.f
</code>
, denoting a field
<code>
f
</code>
of the struct denoted by
<code>
s
</code>
or
<code>
*s
</code>
, and returns the field offset in bytes relative to the struct's address.
If
<code>
f
</code>
is an
<a
href=
"#Struct_types"
>
embedded field
</a>
, it must be reachable
without pointer indirections through fields of the struct.
For a struct
<code>
s
</code>
with field
<code>
f
</code>
:
</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment