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

Issue 109640045: code review 109640045: cgo: disable inappropriate warnings when the gcc struct... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by snyh
Modified:
10 years, 10 months ago
Reviewers:
gobot, minux, dave
CC:
golang-codereviews, iant, minux, dave_cheney.net
Visibility:
Public.

Description

cmd/cgo: disable inappropriate warnings when the gcc struct is empty package main //#cgo CFLAGS: -Wall //void test() {} import "C" func main() { C.test() } This code will cause gcc issuing warnings about unused variable. This commit use offset of the second return value of Packages.structType to detect whether the gcc struct is empty, and if it's directly invoke the C function instead of writing an unused code.

Patch Set 1 #

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

Total comments: 1

Patch Set 3 : diff -r 8e05add24c7e https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -2 lines) Patch
A misc/cgo/test/empty.go View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
M src/cmd/cgo/out.go View 1 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 17
snyh
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
10 years, 10 months ago (2014-07-10 14:20:21 UTC) #1
iant
Please add a test to misc/cgo/test.
10 years, 10 months ago (2014-07-10 15:41:41 UTC) #2
minux
On Thu, Jul 10, 2014 at 11:41 AM, <iant@golang.org> wrote: > Please add a test ...
10 years, 10 months ago (2014-07-10 16:31:51 UTC) #3
snyh
If there really need a test file, what it should be do? I'm not familiar ...
10 years, 10 months ago (2014-07-11 03:23:09 UTC) #4
minux
On 2014/07/11 03:23:09, snyh wrote: > like minux says, this warnings can be produce easily. ...
10 years, 10 months ago (2014-07-11 03:31:12 UTC) #5
snyh
On 2014/07/10 15:41:41, iant wrote: > Please add a test to misc/cgo/test. With the help ...
10 years, 10 months ago (2014-07-11 09:10:11 UTC) #6
dave_cheney.net
LGTM. Thank you for adding the test. Please remove the asterisks' in the description, we ...
10 years, 10 months ago (2014-07-16 10:19:31 UTC) #7
dave_cheney.net
Ian, do you have any further comments ? Otherwise, would you please submit this. On ...
10 years, 10 months ago (2014-07-16 10:32:13 UTC) #8
iant
https://codereview.appspot.com/109640045/diff/80001/misc/cgo/test/issue109640045.go File misc/cgo/test/issue109640045.go (right): https://codereview.appspot.com/109640045/diff/80001/misc/cgo/test/issue109640045.go#newcode5 misc/cgo/test/issue109640045.go:5: // issue 109640045 fix unused variable warnings/errors caused This ...
10 years, 10 months ago (2014-07-16 16:12:39 UTC) #9
minux
Also, please change the description to start with "cmd/cgo:" rather than "cgo:" PS: if you ...
10 years, 10 months ago (2014-07-16 16:15:52 UTC) #10
snyh
On 2014/07/16 16:15:52, minux wrote: > Also, please change the description to start with "cmd/cgo:" ...
10 years, 10 months ago (2014-07-17 01:08:03 UTC) #11
minux
LGTM. Have you signed the CLA (see http://golang.org/doc/contribute.html#copyright)? I searched for your email, but didn't ...
10 years, 10 months ago (2014-07-17 05:13:35 UTC) #12
minux
*** Submitted as https://code.google.com/p/go/source/detail?r=f97fb06525e5 *** cmd/cgo: disable inappropriate warnings when the gcc struct is empty ...
10 years, 10 months ago (2014-07-18 06:47:24 UTC) #13
gobot
This CL appears to have broken the freebsd-amd64 builder. See http://build.golang.org/log/28b084a3e502cd20788aebda99b7ec9cf22e9dd8
10 years, 10 months ago (2014-07-18 06:52:49 UTC) #14
dave_cheney.net
Yup, this is real. > On 18 Jul 2014, at 16:52, gobot@golang.org wrote: > > ...
10 years, 10 months ago (2014-07-18 06:54:11 UTC) #15
minux
On Fri, Jul 18, 2014 at 2:54 AM, Dave Cheney <dave@cheney.net> wrote: > Yup, this ...
10 years, 10 months ago (2014-07-18 06:58:04 UTC) #16
minux
10 years, 10 months ago (2014-07-18 07:02:55 UTC) #17
Hi snyh,

This change appear to have broken freebsd system, and I have rolled it back.
It's clang related, please do this to reproduce the problem on Linux:
CC=clang go test -v ../misc/cgo/test
Sign in to reply to this message.

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