Globally force -Wdeprecated-declarations to be a warning.
Some code compiles with -Werror, which makes it very hard to mark
anything as deprecated without breaking the build. This option
will ensure that we can still mark things as deprecated without
breaking such code. Among other things, this will allow us to
undo a local change to protobuf which disables deprecation
warnings.
Bug: 203713560
Test: presubmit
Change-Id: I718de31c3ff685dba4104f3c9e7bd5d169d89f7e
diff --git a/cc/config/global.go b/cc/config/global.go
index 26d93ab..357ea44 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -59,6 +59,10 @@
"-Werror=string-plus-int",
"-Werror=unreachable-code-loop-increment",
+ // Force deprecation warnings to be warnings for code that compiles with -Werror.
+ // Making deprecated usages an error causes extreme pain when trying to deprecate anything.
+ "-Wno-error=deprecated-declarations",
+
"-D__compiler_offsetof=__builtin_offsetof",
// Emit address-significance table which allows linker to perform safe ICF. Clang does
@@ -286,8 +290,7 @@
"-Wno-deprecated-non-prototype",
}
- llvmNextExtraCommonGlobalCflags = []string{
- }
+ llvmNextExtraCommonGlobalCflags = []string{}
IllegalFlags = []string{
"-w",