1
0
mirror of https://github.com/golang/go synced 2024-11-23 14:50:07 -07:00
go/misc
snyh 086df1dc77 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.

LGTM=dave, minux
R=golang-codereviews, iant, minux, dave
CC=golang-codereviews
https://golang.org/cl/109640045
2014-07-18 02:47:21 -04:00
..
android androidtest.bash, misc/android: build scripts for android 2014-07-09 06:56:49 -04:00
arm
cgo cmd/cgo: disable inappropriate warnings when the gcc struct is empty 2014-07-18 02:47:21 -04:00
chrome/gophertool
dashboard/codereview misc/dashboard/app, misc/dashboard/builder: delete from main repo; part of move to go.tools 2013-08-01 13:27:27 +10:00
git misc/git: add gofmt git pre-commit hook 2012-11-15 19:58:49 +01:00
linkcheck misc/linkcheck: better redirect handling, use meaningful exit code 2013-10-25 17:31:02 +03:00
makerelease misc/makerelease: update default tag to release-branch.go1.3 2014-06-12 13:29:22 +10:00
nacl misc/nacl: add go_nacl_arm_exec, update README 2014-07-10 15:15:32 -04:00
swig cmd/go: add any .c/.cc files to the SWIG shared library 2013-10-09 10:35:46 -07:00
benchcmp benchcmp: leave a forwarding script 2014-03-31 16:39:41 -04:00
editors misc: delete editor and shell support 2014-07-01 09:21:25 -07:00
pprof misc/pprof: always use go tool objdump on windows 2014-05-15 15:54:42 +10:00