• snyh's avatar
    cmd/cgo: disable inappropriate warnings when the gcc struct is empty · 086df1dc
    snyh authored
    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
    086df1dc
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...