Adds a new config to disable size_t -> int truncations and use it in various places where the x64 Windows build currently gives warnings.

This covers Chrome (except for Blink which has a separate patch) and the tests.

We should do a second pass to replace the existing instances of /wd4267 with this config.

Review URL: https://codereview.chromium.org/927363005

Cr-Original-Commit-Position: refs/heads/master@{#316874}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1deb76bc64a51808cd3df93d8166f223241487fe
This commit is contained in:
brettw 2015-02-18 11:28:20 -08:00 коммит произвёл Commit bot
Родитель d3389c9f93
Коммит 032e1c5b9d
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -881,6 +881,20 @@ config("wexit_time_destructors") {
}
}
# On Windows compiling on x64, VC will issue a warning when converting
# size_t to int because it will truncate the value. Our code should not have
# these warnings and one should use a static_cast or a checked_cast for the
# conversion depending on the case. However, a lot of code still needs to be
# fixed. Apply this config to such targets to disable the warning.
#
# Note that this can be applied regardless of platform and architecture to
# clean up the call sites. This will only apply the flag when necessary.
config("no_size_t_to_int_warning") {
if (is_win && cpu_arch == "x64") {
cflags = [ "/wd4267" ]
}
}
# Optimization -----------------------------------------------------------------
#
# Note that BUILDCONFIG.gn sets up a variable "default_optimization_config"