Skip to content

Commit 54e76fb

Browse files
committed
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 7a10b86 commit 54e76fb

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
@@ -274,18 +274,6 @@
274274
'BufferSecurityCheck': 'true',
275275
'ExceptionHandling': 0, # /EHsc
276276
'SuppressStartupBanner': 'true',
277-
# Disable warnings:
278-
# - "C4251: class needs to have dll-interface"
279-
# - "C4275: non-DLL-interface used as base for DLL-interface"
280-
# Over 10k of these warnings are generated when compiling node,
281-
# originating from v8.h. Most of them are false positives.
282-
# See also: https://github.com/nodejs/node/pull/15570
283-
# TODO: re-enable when Visual Studio fixes these upstream.
284-
#
285-
# - "C4267: conversion from 'size_t' to 'int'"
286-
# Many any originate from our dependencies, and their sheer number
287-
# drowns out other, more legitimate warnings.
288-
'DisableSpecificWarnings': ['4251', '4275', '4267'],
289277
'WarnAsError': 'false',
290278
},
291279
'VCLinkerTool': {
@@ -316,7 +304,20 @@
316304
'SuppressStartupBanner': 'true',
317305
},
318306
},
319-
'msvs_disabled_warnings': [4351, 4355, 4800],
307+
# Disable warnings:
308+
# - "C4251: class needs to have dll-interface"
309+
# - "C4275: non-DLL-interface used as base for DLL-interface"
310+
# Over 10k of these warnings are generated when compiling node,
311+
# originating from v8.h. Most of them are false positives.
312+
# See also: https://github.com/nodejs/node/pull/15570
313+
# TODO: re-enable when Visual Studio fixes these upstream.
314+
#
315+
# - "C4267: conversion from 'size_t' to 'int'"
316+
# Many any originate from our dependencies, and their sheer number
317+
# drowns out other, more legitimate warnings.
318+
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
319+
# Ususaly safe. Disable for `dep`, enable for `src`
320+
'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267],
320321
'conditions': [
321322
['asan == 1 and OS != "mac"', {
322323
'cflags+': [

node.gyp

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

0 commit comments

Comments
 (0)