mirror of https://github.com/golang/go.git
cmd/cgo: pass -Wsystem-headers when looking for errors
This works around a bug in GCC 4.8.0. Fixes #5118. R=golang-dev, r, minux.ma CC=golang-dev https://golang.org/cl/9120045
This commit is contained in:
parent
e1922febbe
commit
8a28085a0f
|
|
@ -809,6 +809,15 @@ func (p *Package) gccDefines(stdin []byte) string {
|
|||
func (p *Package) gccErrors(stdin []byte) string {
|
||||
// TODO(rsc): require failure
|
||||
args := p.gccCmd()
|
||||
|
||||
// GCC 4.8.0 has a bug: it sometimes does not apply
|
||||
// -Wunused-value to values that are macros defined in system
|
||||
// headers. See issue 5118. Adding -Wsystem-headers avoids
|
||||
// that problem. This will produce additional errors, but it
|
||||
// doesn't matter because we will ignore all errors that are
|
||||
// not marked for the cgo-test file.
|
||||
args = append(args, "-Wsystem-headers")
|
||||
|
||||
if *debugGcc {
|
||||
fmt.Fprintf(os.Stderr, "$ %s <<EOF\n", strings.Join(args, " "))
|
||||
os.Stderr.Write(stdin)
|
||||
|
|
|
|||
Loading…
Reference in New Issue