mirror of
https://github.com/golang/go
synced 2024-11-20 00:24:43 -07:00
dist: add clang specific -Wno options
Clang 3.1 has more warnings enabled by default than GCC. Combined with -Werror, they cause the build to fail unnecessarily. if the name of our compiler ends in "clang", add the necessary extra -Wno options. Ideally we would add these flags unconditionally, as GCC is supposed to ignore unknown -Wno flags, but apple's llvm-gcc doesn't. Fixes #2878. R=rsc, dave CC=golang-dev https://golang.org/cl/5673055
This commit is contained in:
parent
5c598d3c9f
commit
7c2bfa4f2c
4
src/cmd/dist/build.c
vendored
4
src/cmd/dist/build.c
vendored
@ -582,6 +582,10 @@ install(char *dir)
|
|||||||
splitfields(&gccargs, bstr(&b));
|
splitfields(&gccargs, bstr(&b));
|
||||||
for(i=0; i<nelem(proto_gccargs); i++)
|
for(i=0; i<nelem(proto_gccargs); i++)
|
||||||
vadd(&gccargs, proto_gccargs[i]);
|
vadd(&gccargs, proto_gccargs[i]);
|
||||||
|
if(xstrstr(gccargs.p[0], "clang") != nil) {
|
||||||
|
vadd(&gccargs, "-Wno-dangling-else");
|
||||||
|
vadd(&gccargs, "-Wno-unused-value");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc");
|
islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc");
|
||||||
|
Loading…
Reference in New Issue
Block a user