Skip to content

Commit b4a79ac

Browse files
refacktargos
authored andcommitted
build,win: exclude warning 4244 only for deps
* also unify warning exclusion directive PR-URL: #22698 Reviewed-By: João Reis <[email protected]>
1 parent dbe27d7 commit b4a79ac

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

common.gypi

+14-13
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,6 @@
264264
'BufferSecurityCheck': 'true',
265265
'ExceptionHandling': 0, # /EHsc
266266
'SuppressStartupBanner': 'true',
267-
# Disable warnings:
268-
# - "C4251: class needs to have dll-interface"
269-
# - "C4275: non-DLL-interface used as base for DLL-interface"
270-
# Over 10k of these warnings are generated when compiling node,
271-
# originating from v8.h. Most of them are false positives.
272-
# See also: https://github.com/nodejs/node/pull/15570
273-
# TODO: re-enable when Visual Studio fixes these upstream.
274-
#
275-
# - "C4267: conversion from 'size_t' to 'int'"
276-
# Many any originate from our dependencies, and their sheer number
277-
# drowns out other, more legitimate warnings.
278-
'DisableSpecificWarnings': ['4251', '4275', '4267'],
279267
'WarnAsError': 'false',
280268
},
281269
'VCLinkerTool': {
@@ -306,7 +294,20 @@
306294
'SuppressStartupBanner': 'true',
307295
},
308296
},
309-
'msvs_disabled_warnings': [4351, 4355, 4800],
297+
# Disable warnings:
298+
# - "C4251: class needs to have dll-interface"
299+
# - "C4275: non-DLL-interface used as base for DLL-interface"
300+
# Over 10k of these warnings are generated when compiling node,
301+
# originating from v8.h. Most of them are false positives.
302+
# See also: https://github.com/nodejs/node/pull/15570
303+
# TODO: re-enable when Visual Studio fixes these upstream.
304+
#
305+
# - "C4267: conversion from 'size_t' to 'int'"
306+
# Many any originate from our dependencies, and their sheer number
307+
# drowns out other, more legitimate warnings.
308+
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
309+
# Ususaly safe. Disable for `dep`, enable for `src`
310+
'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267],
310311
'conditions': [
311312
['asan == 1 and OS != "mac"', {
312313
'cflags+': [

node.gyp

+10
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@
238238
'src',
239239
'deps/v8/include',
240240
],
241+
242+
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
243+
# Ususaly safe. Disable for `dep`, enable for `src`
244+
'msvs_disabled_warnings!': [4244],
245+
241246
'conditions': [
242247
[ 'node_intermediate_lib_type=="static_library" and '
243248
'node_shared=="true" and OS=="aix"', {
@@ -471,6 +476,11 @@
471476
'V8_DEPRECATION_WARNINGS=1',
472477
'NODE_OPENSSL_SYSTEM_CERT_PATH="<(openssl_system_ca_path)"',
473478
],
479+
480+
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
481+
# Ususaly safe. Disable for `dep`, enable for `src`
482+
'msvs_disabled_warnings!': [4244],
483+
474484
'conditions': [
475485
[ 'node_code_cache_path!=""', {
476486
'sources': [ '<(node_code_cache_path)' ]

0 commit comments

Comments
 (0)