Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1100)

Issue 106260044: code review 106260044: cmd/cgo: for -godefs, promote first field of anonymous union (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 7 months ago by iant
Modified:
7 years, 5 months ago
Reviewers:
mikio
CC:
golang-codereviews, mikio
Visibility:
Public.

Description

cmd/cgo: for -godefs, promote first field of anonymous union Update issue 6677 When a struct contains an anonymous union, use the type and name of the first field in the union. This should make the glibc <sys/resource.h> file work; in that file struct rusage has fields like __extension__ union { long int ru_maxrss; __syscall_slong_t __ru_maxrss_word; }; in which the field that matters is ru_maxrss and __ru_maxrss_word just exists to advance to the next field on systems where the kernel uses long long fields but userspace expects long fields.

Patch Set 1 #

Patch Set 2 : diff -r dff49040426d https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -2 lines) Patch
A misc/cgo/testgodefs/anonunion.go View 1 chunk +26 lines, -0 lines 0 comments Download
A misc/cgo/testgodefs/main.go View 1 chunk +12 lines, -0 lines 0 comments Download
A misc/cgo/testgodefs/test.bash View 1 chunk +20 lines, -0 lines 0 comments Download
M src/cmd/cgo/gcc.go View 2 chunks +21 lines, -2 lines 0 comments Download

Messages

Total messages: 3
iant
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
7 years, 7 months ago (2014-06-28 00:35:36 UTC) #1
mikio
lgtm
7 years, 6 months ago (2014-06-29 01:56:03 UTC) #2
iant
7 years, 5 months ago (2014-08-06 00:10:20 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=d1cf884a594f ***

cmd/cgo: for -godefs, promote first field of anonymous union

Update issue 6677

When a struct contains an anonymous union, use the type and
name of the first field in the union.

This should make the glibc <sys/resource.h> file work; in that
file struct rusage has fields like

__extension__ union
{
        long int ru_maxrss;
        __syscall_slong_t __ru_maxrss_word;
};

in which the field that matters is ru_maxrss and
__ru_maxrss_word just exists to advance to the next field on
systems where the kernel uses long long fields but userspace
expects long fields.

LGTM=mikioh.mikioh
R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://codereview.appspot.com/106260044
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b