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

Unified Diff: build/config/compiler/BUILD.gn

Issue 538333002: gn/linux: warnings as errors, turn on Wextra (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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 | « ash/shelf/shelf_view.h ('k') | build/secondary/third_party/icu/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index b04d6dfe35279fd527035de16bc5e1552b7cd0ea..f5eb6a6799082cd1c75a39bf75fe7a68c3a853ea 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -472,8 +472,6 @@ config("runtime_library") {
# Toggles between higher and lower warnings for code that is (or isn't)
# part of Chromium.
-# TODO: -Werror should always be on, independent of chromium_code
-# http://crbug.com/393046
config("chromium_code") {
if (is_win) {
cflags = [
@@ -482,6 +480,7 @@ config("chromium_code") {
} else {
cflags = [
"-Wall",
+ "-Wextra",
# GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
# so we specify it explicitly.
@@ -489,11 +488,6 @@ config("chromium_code") {
# http://code.google.com/p/chromium/issues/detail?id=90453
"-Wsign-compare",
]
- if (!is_linux) {
- # TODO: Add this unconditionally once linux builds without warnings with
- # clang in the gn build.
- cflags += [ "-Werror" ]
- }
# In Chromium code, we define __STDC_foo_MACROS in order to get the
# C99 macros on Mac and Linux.
@@ -501,12 +495,6 @@ config("chromium_code") {
"__STDC_CONSTANT_MACROS",
"__STDC_FORMAT_MACROS",
]
-
- # TODO(brettw) this should also be enabled on Linux but some files
- # currently fail.
- if (is_mac) {
- cflags += [ "-Wextra" ]
- }
}
}
config("no_chromium_code") {
@@ -659,6 +647,7 @@ config("default_warnings") {
cflags = [
# Enables.
"-Wendif-labels", # Weird old-style text after an #endif.
+ "-Werror", # Warnings as errors.
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | build/secondary/third_party/icu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698