summaryrefslogtreecommitdiffstats
path: root/build/common.gypi
diff options
context:
space:
mode:
authorbrucedawson <brucedawson@chromium.org>2015-12-09 18:22:44 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-10 02:23:46 +0000
commitd3beca7e8267b3db4e8245eb588147639a1b1bd2 (patch)
treee7f9e15b23bdcfd1deb471542362f39b0707f51e /build/common.gypi
parent46c880331aaad20da0d966ca2240ff820bb41e28 (diff)
downloadchromium_src-d3beca7e8267b3db4e8245eb588147639a1b1bd2.zip
chromium_src-d3beca7e8267b3db4e8245eb588147639a1b1bd2.tar.gz
chromium_src-d3beca7e8267b3db4e8245eb588147639a1b1bd2.tar.bz2
Fixing remaining VC++ 2015 64-bit build breaks
VC++ 2015 64-bit builds trigger many new warnings about possibly unintended truncation bugs. Some of the bugs have a very low signal-to- noise ratio and this change suppresses them (4311 and 4312). Others seem to find some real bugs so I am leaving them enabled for now (4302 and 4334), fixing the bugs, and adjusting the code to suppress the other warnings. The changes in shell_web_contents_view_delegate_win.cc, ipc_perftest_support.cc, test_root_certs_win.cc, TracedLayoutObject.* and TraceEvent.h appear to fix real truncation bugs. Typical warnings are: ipc\ipc_perftest_support.cc(351): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) net\cert\test_root_certs_win.cc(103): warning C4302: 'reinterpret_cast': truncation from 'LPCSTR' to 'uint32_t' The main pattern is that VC++ 2015 is suspicious of code that converts a 64-bit pointer to a 32-bit integer. If the code converts from a pointer to a 64-bit integer, and then to a 32-bit integer, separating the type change from the truncation, then it assumes that the truncation is intentional. This seems like a reasonable heuristic. The warnings in the generated code were suppressed because they aren't bugs and because fixing gperf.exe (untouched since 2004) does not seem worthwhile. The warnings from gperf generated code look like: out\release_x64\gen\blink\core\csspropertynames.cpp(2914): warning C4302: 'type cast': truncation from 'char (*)[28]' to 'long' out\release_x64\gen\blink\core\cssvaluekeywords.cpp(3409): warning C4302: 'type cast': truncation from 'char (*)[4]' to 'long' Note that Windows HANDLE types are a wrapper around a pointer, but due to WOW64 (32-bit process on 64-bit Windows) compatibility they are always 32-bit values that can safely be truncated, then sign-extended back. Unfortunately Microsoft does not supply a safe-truncation macro. https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203%28v=vs.85%29.aspx Also a few uncommented warning-disables in common.gypi were commented. Setting NOTRY=true because the change is hitting timeouts. See crbug.com/567377 and comment #119 for details. NOTRY=true BUG=440500 Review URL: https://codereview.chromium.org/1422773008 Cr-Commit-Position: refs/heads/master@{#364264}
Diffstat (limited to 'build/common.gypi')
-rw-r--r--build/common.gypi7
1 files changed, 6 insertions, 1 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 5b207f5..e51b958 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -3160,6 +3160,7 @@
'_SCL_SECURE_NO_DEPRECATE',
],
'msvs_disabled_warnings': [
+ # forcing value to bool 'true' or 'false' (performance warning)
4800,
],
'msvs_settings': {
@@ -5660,7 +5661,7 @@
# it's enabled. This will generally only be true for system-level
# installed Express users.
'msvs_disabled_warnings': [
- 4702,
+ 4702, # unreachable code
],
}],
],
@@ -5744,6 +5745,10 @@
# should work through these at some point -- they may be removed from
# the RTM release in the /W4 set.
4456, 4457, 4458, 4459,
+
+ # TODO(brucedawson): http://crbug.com/554200 4312 is a VS
+ # 2015 64-bit warning for integer to larger pointer
+ 4312,
],
'msvs_settings': {
'VCCLCompilerTool': {