Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3692)

Unified Diff: gn/BUILD.gn

Issue 2369033002: GN: detect is_clang, use it to switch Clang to warning blacklist. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gn/is_clang.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gn/BUILD.gn
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 427ab2eec68885e186344df0931abf144c0dd13e..9ffbf4971879ad5e06d6de52fa7ada60da43661a 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -24,6 +24,13 @@ declare_args() {
cc_wrapper = ""
}
+is_clang = exec_script("is_clang.py",
+ [
+ cc,
+ cxx,
+ ],
+ "value")
+
config("default") {
asmflags = []
cflags = []
@@ -70,6 +77,74 @@ config("default") {
"-Wnon-virtual-dtor",
]
+ if (is_clang) {
+ cflags += [
+ "-Weverything",
+ "-Wno-unknown-warning-option", # Let older Clangs ignore newer Clangs' warnings.
+ ]
+
+ # High priority to fix!
+ cflags += [
+ "-Wno-comma",
+ "-Wno-conditional-uninitialized",
+ "-Wno-covered-switch-default",
+ "-Wno-deprecated",
+ "-Wno-format-nonliteral",
+ "-Wno-over-aligned",
+ "-Wno-shadow",
+ "-Wno-shift-sign-overflow",
+ "-Wno-undefined-func-template",
+ "-Wno-undefined-reinterpret-cast",
+ ]
+
+ cflags += [
+ "-Wno-cast-align",
+ "-Wno-class-varargs",
+ "-Wno-conversion",
+ "-Wno-disabled-macro-expansion",
+ "-Wno-documentation",
+ "-Wno-documentation-unknown-command",
+ "-Wno-double-promotion",
+ "-Wno-exit-time-destructors", # TODO: OK outside libskia
+ "-Wno-extra-semi",
+ "-Wno-float-conversion",
+ "-Wno-float-equal",
+ "-Wno-global-constructors", # TODO: OK outside libskia
+ "-Wno-gnu-anonymous-struct",
+ "-Wno-gnu-zero-variadic-macro-arguments",
+ "-Wno-missing-prototypes",
+ "-Wno-missing-variable-declarations",
+ "-Wno-nested-anon-types",
+ "-Wno-newline-eof",
+ "-Wno-pedantic",
+ "-Wno-reserved-id-macro",
+ "-Wno-sign-conversion",
+ "-Wno-switch-enum",
+ "-Wno-undef",
+ "-Wno-unreachable-code",
+ "-Wno-unreachable-code-break",
+ "-Wno-unreachable-code-return",
+ "-Wno-unused-macros",
+ "-Wno-unused-member-function",
+ ]
+ cflags_cc += [
+ "-Wno-abstract-vbase-init",
+ "-Wno-range-loop-analysis",
+ "-Wno-weak-vtables",
+ ]
+
+ # We are unlikely to want to fix these.
+ cflags += [
+ "-Wno-implicit-fallthrough",
+ "-Wno-missing-noreturn",
+ "-Wno-old-style-cast",
+ "-Wno-padded",
+ ]
+ cflags_cc += [
+ "-Wno-c++98-compat",
+ "-Wno-c++98-compat-pedantic",
+ ]
+ }
}
if (current_cpu == "arm") {
« no previous file with comments | « no previous file | gn/is_clang.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698