Commit b6e3a98c authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

cmd/go: make C compiler warnings fatal on builders

Fixes #14698

Change-Id: I82fa781bf136c30e900d8e910ff576ba8b218acb
Reviewed-on: https://go-review.googlesource.com/23005
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 2af00eb6
...@@ -3000,9 +3000,19 @@ func (b *builder) gfortran(p *Package, out string, flags []string, ffile string) ...@@ -3000,9 +3000,19 @@ func (b *builder) gfortran(p *Package, out string, flags []string, ffile string)
} }
// ccompile runs the given C or C++ compiler and creates an object from a single source file. // ccompile runs the given C or C++ compiler and creates an object from a single source file.
func (b *builder) ccompile(p *Package, out string, flags []string, file string, compiler []string) error { func (b *builder) ccompile(p *Package, outfile string, flags []string, file string, compiler []string) error {
file = mkAbs(p.Dir, file) file = mkAbs(p.Dir, file)
return b.run(p.Dir, p.ImportPath, nil, compiler, flags, "-o", out, "-c", file) desc := p.ImportPath
output, err := b.runOut(p.Dir, desc, nil, compiler, flags, "-o", outfile, "-c", file)
if len(output) > 0 {
b.showOutput(p.Dir, desc, b.processOutput(output))
if err != nil {
err = errPrintedOutput
} else if os.Getenv("GO_BUILDER_NAME") != "" {
return errors.New("C compiler warning promoted to error on Go builders")
}
}
return err
} }
// gccld runs the gcc linker to create an executable from a set of object files. // gccld runs the gcc linker to create an executable from a set of object files.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment