summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting <pkasting@chromium.org>2015-07-27 15:54:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-27 22:55:41 +0000
commitd408e1965f8e03629738039289ab7779c42a318c (patch)
tree0c8dd98f117475c4476393f48504fa579ee5e9b2
parent8d4e4e1d03877db56839e53881cd2c4dfc9ee4b8 (diff)
downloadchromium_src-d408e1965f8e03629738039289ab7779c42a318c.zip
chromium_src-d408e1965f8e03629738039289ab7779c42a318c.tar.gz
chromium_src-d408e1965f8e03629738039289ab7779c42a318c.tar.bz2
Enable C4018 globally for the GN build, and disable per-target.
This matches what the GYP build does. BUG=398202 TEST=none Review URL: https://codereview.chromium.org/1246103007 Cr-Commit-Position: refs/heads/master@{#340590}
-rw-r--r--build/config/compiler/BUILD.gn5
-rw-r--r--components/filesystem/file_impl.cc2
-rw-r--r--third_party/leveldatabase/BUILD.gn4
-rw-r--r--third_party/libexif/BUILD.gn2
-rw-r--r--third_party/libxml/BUILD.gn5
-rw-r--r--third_party/mesa/BUILD.gn1
-rw-r--r--third_party/protobuf/BUILD.gn10
-rw-r--r--third_party/qcms/BUILD.gn1
-rw-r--r--third_party/re2/BUILD.gn5
-rw-r--r--third_party/snappy/BUILD.gn4
10 files changed, 25 insertions, 14 deletions
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 4b3c264..871abf2 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -723,11 +723,6 @@ if (is_win) {
# Warnings permanently disabled:
- # TODO(GYP) The GYP build doesn't have this globally enabled but disabled
- # for a bunch of individual targets. Re-enable this globally when those
- # targets are fixed.
- "/wd4018", # Comparing signed and unsigned values.
-
# C4127: conditional expression is constant
# This warning can in theory catch dead code and other problems, but
# triggers in far too many desirable cases where the conditional
diff --git a/components/filesystem/file_impl.cc b/components/filesystem/file_impl.cc
index 2539498..4925f9a 100644
--- a/components/filesystem/file_impl.cc
+++ b/components/filesystem/file_impl.cc
@@ -102,7 +102,7 @@ void FileImpl::Write(mojo::Array<uint8_t> bytes_to_write,
// actually wrote that much).
if (bytes_to_write.size() >
#if defined(OS_WIN)
- std::numeric_limits<INT>::max()) {
+ static_cast<size_t>(std::numeric_limits<int>::max())) {
#else
static_cast<size_t>(std::numeric_limits<ssize_t>::max())) {
#endif
diff --git a/third_party/leveldatabase/BUILD.gn b/third_party/leveldatabase/BUILD.gn
index c29f0f8..b3080d8 100644
--- a/third_party/leveldatabase/BUILD.gn
+++ b/third_party/leveldatabase/BUILD.gn
@@ -113,6 +113,10 @@ static_library("leveldatabase") {
"//third_party/re2",
"//third_party/snappy",
]
+
+ if (is_win) {
+ cflags = [ "/wd4018" ] # Signed/unsigned mismatch in comparison.
+ }
}
if (!is_android) {
diff --git a/third_party/libexif/BUILD.gn b/third_party/libexif/BUILD.gn
index 5a464e6..8eba113 100644
--- a/third_party/libexif/BUILD.gn
+++ b/third_party/libexif/BUILD.gn
@@ -60,7 +60,7 @@ if (!is_linux || is_chromeos) {
ldflags = [ "/DEF:" + rebase_path("libexif.def") ]
- cflags = [ "/wd4018" ] # size/unsigned mismatch
+ cflags = [ "/wd4018" ] # Signed/unsigned mismatch in comparison.
# TODO(GYP): Handle /analyze switch, when it will be used in GN.
} else if (is_linux) {
diff --git a/third_party/libxml/BUILD.gn b/third_party/libxml/BUILD.gn
index 1f10dee..58a5f1c 100644
--- a/third_party/libxml/BUILD.gn
+++ b/third_party/libxml/BUILD.gn
@@ -155,7 +155,10 @@ static_library("libxml") {
]
if (is_win) {
- cflags_c = [ "/wd4101" ] # Unreferenced local variable.
+ cflags_c = [
+ "/wd4018", # Signed/unsigned mismatch in comparison.
+ "/wd4101", # Unreferenced local variable.
+ ]
} else if (is_mac || is_ios || is_android) {
# http://www.xmlsoft.org/threads.html says that this is required when using
# libxml from several threads, which can possibly happen in chrome. On
diff --git a/third_party/mesa/BUILD.gn b/third_party/mesa/BUILD.gn
index 3ff2155..62f8611 100644
--- a/third_party/mesa/BUILD.gn
+++ b/third_party/mesa/BUILD.gn
@@ -135,6 +135,7 @@ config("mesa_internal_warnings") {
# Mesa is ever rolled and the warnings are fixed.
cflags += [
"/wd4005", # Macro defined twice.
+ "/wd4018", # Signed/unsigned mismatch in comparison.
"/wd4065", # Switch statement contains 'default' but no 'case' labels.
"/wd4090", # 'Operation' : different 'modifier' qualifiers
"/wd4099", # Type name struct-vs-class doesn't match.
diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn
index 0c57bd6..7d42a00d 100644
--- a/third_party/protobuf/BUILD.gn
+++ b/third_party/protobuf/BUILD.gn
@@ -77,11 +77,11 @@ protobuf_lite_sources = [
protobuf_lite_cflags = []
if (is_win) {
protobuf_lite_cflags = [
- "/wd4018", # signed/unsigned mismatch in comparison
- "/wd4244", # implicit conversion, possible loss of data
- "/wd4355", # 'this' used in base member initializer list
- "/wd4267", # size_t to int truncation
- "/wd4291", # no matching operator delete for a placement new
+ "/wd4018", # Signed/unsigned mismatch in comparison.
+ "/wd4244", # Implicit conversion, possible loss of data.
+ "/wd4355", # 'this' used in base member initializer list.
+ "/wd4267", # Size_t to int truncation.
+ "/wd4291", # No matching operator delete for a placement new.
]
}
diff --git a/third_party/qcms/BUILD.gn b/third_party/qcms/BUILD.gn
index 5e27d44..a4b60d3 100644
--- a/third_party/qcms/BUILD.gn
+++ b/third_party/qcms/BUILD.gn
@@ -32,6 +32,7 @@ source_set("qcms") {
if (is_win) {
cflags = [
+ "/wd4018", # Signed/unsigned mismatch in comparison.
"/wd4056", # Overflow in floating-point constant arithmetic (INFINITY).
"/wd4756", # Overflow in constant arithmetic (INFINITY).
]
diff --git a/third_party/re2/BUILD.gn b/third_party/re2/BUILD.gn
index 2bc130a..ca1f7a2 100644
--- a/third_party/re2/BUILD.gn
+++ b/third_party/re2/BUILD.gn
@@ -67,7 +67,10 @@ static_library("re2") {
if (is_win) {
include_dirs = [ "mswin" ]
- cflags = [ "/wd4722" ] # Destructor never terminates.
+ cflags = [
+ "/wd4018", # Signed/unsigned mismatch in comparison.
+ "/wd4722", # Destructor never terminates.
+ ]
} else {
sources -= [ "mswin/stdint.h" ]
}
diff --git a/third_party/snappy/BUILD.gn b/third_party/snappy/BUILD.gn
index 4af0e81..e8de575 100644
--- a/third_party/snappy/BUILD.gn
+++ b/third_party/snappy/BUILD.gn
@@ -31,6 +31,10 @@ static_library("snappy") {
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":snappy_config" ]
+ if (is_win) {
+ cflags = [ "/wd4018" ] # Signed/unsigned mismatch in comparison.
+ }
+
if (is_clang) {
# snappy-stubs-internal.h unapologetically has: using namespace std
# https://code.google.com/p/snappy/issues/detail?id=70