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

Unified Diff: build/common.gypi

Issue 1551753002: Build third-party code with -Wall, build chromium_code with -Wextra on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig Created 4 years, 12 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 | « base/android/context_utils.cc ('k') | build/config/compiler/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index c3bc3dff43c892f8930db4e60954bdfab835a581..99f36e030acf67088323b70974efe042ac98976a 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -3141,11 +3141,8 @@
'conditions': [
[ 'os_posix==1 and OS!="mac" and OS!="ios"', {
# We don't want to get warnings from third-party code,
- # so remove any existing warning-enabling flags like -Wall.
- 'cflags!': [
- '-Wall',
- '-Wextra',
- ],
+ # so remove any existing warning-enabling flags like -Wextra.
+ 'cflags!': [ '-Wextra' ],
'cflags_cc': [
# Don't warn about hash_map in third-party code.
'-Wno-deprecated',
@@ -3155,10 +3152,11 @@
# This is off by default in gcc but on in Ubuntu's gcc(!).
'-Wno-format',
],
- 'cflags_cc!': [
- # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
- '-Wsign-compare',
- ]
+ }],
+ [ 'os_posix==1 and clang!=1 and OS!="mac" and OS!="ios"', {
+ # When we don't control the compiler, don't use -Wall for
+ # third-party code either.
+ 'cflags!': [ '-Wall' ],
}],
# TODO: Fix all warnings on chromeos too.
[ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
@@ -3210,7 +3208,7 @@
[ 'OS=="mac" or OS=="ios"', {
'xcode_settings': {
- 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
+ 'WARNING_CFLAGS!': ['-Wextra'],
},
'conditions': [
['buildtype=="Official"', {
@@ -3723,6 +3721,10 @@
'variables': {
'werror%': '-Werror',
'libraries_for_target%': '',
+ 'conditions' : [
+ # Enable -Wextra when we control the compiler.
+ ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }],
+ ],
},
'defines': [
'_FILE_OFFSET_BITS=64',
@@ -3732,6 +3734,7 @@
'-pthread',
'-fno-strict-aliasing', # See http://crbug.com/32204
'-Wall',
+ '<(wextra)',
# Don't warn about unused function params. We use those everywhere.
'-Wno-unused-parameter',
# Don't warn about the "struct foo f = {0};" initialization pattern.
@@ -3748,9 +3751,6 @@
# Make inline functions have hidden visiblity by default.
# Surprisingly, not covered by -fvisibility=hidden.
'-fvisibility-inlines-hidden',
- # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
- # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
- '-Wsign-compare',
],
'ldflags': [
'-pthread', '-Wl,-z,noexecstack',
« no previous file with comments | « base/android/context_utils.cc ('k') | build/config/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698