summaryrefslogtreecommitdiffstats
path: root/build/common.gypi
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-12-31 22:55:50 -0500
committerNico Weber <thakis@chromium.org>2016-01-01 03:57:06 +0000
commitfc84336d83b1e8feb752d7170bdba3f44ff069a4 (patch)
treec72cf2633a905be7f2f648832104d9ef5c8d1a18 /build/common.gypi
parent9830789346abd3d8211deff1ebe7a7f5753ba3fc (diff)
downloadchromium_src-fc84336d83b1e8feb752d7170bdba3f44ff069a4.zip
chromium_src-fc84336d83b1e8feb752d7170bdba3f44ff069a4.tar.gz
chromium_src-fc84336d83b1e8feb752d7170bdba3f44ff069a4.tar.bz2
Linux/CrOS/Cast/Android (and Mac with gn): Build chromium_code with -Wextra.
Lands the -Wextra bits of https://codereview.chromium.org/1551753002/ (reviewed there). Windows, Mac, and iOS already build chromium_code with -Wextra. (Mac and iOS only in the gyp build, not in gn yet.) This makes the other platforms match and also adds -Wextra to chromium_code in gn builds. BUG=573250,572776 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1552863004 . Cr-Commit-Position: refs/heads/master@{#367256}
Diffstat (limited to 'build/common.gypi')
-rw-r--r--build/common.gypi12
1 files changed, 5 insertions, 7 deletions
diff --git a/build/common.gypi b/build/common.gypi
index d629321..ae65c06 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -3155,10 +3155,6 @@
# 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',
- ]
}],
# TODO: Fix all warnings on chromeos too.
[ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
@@ -3723,6 +3719,10 @@
'variables': {
'werror%': '-Werror',
'libraries_for_target%': '',
+ 'conditions' : [
+ # Enable -Wextra for chromium_code when we control the compiler.
+ ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }],
+ ],
},
'defines': [
'_FILE_OFFSET_BITS=64',
@@ -3732,6 +3732,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 +3749,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',