-
Notifications
You must be signed in to change notification settings - Fork 7.3k
build: fix or suppress warnings #8485
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,9 +129,13 @@ | |
'BufferSecurityCheck': 'true', | ||
'ExceptionHandling': 1, # /EHsc | ||
'SuppressStartupBanner': 'true', | ||
'WarnAsError': 'false', | ||
'WarnAsError': 'true', | ||
}, | ||
# 4221 - linker warning about object not exporting new symbols | ||
'VCLibrarianTool': { | ||
'AdditionalOptions': [ | ||
'/ignore:4221', | ||
], | ||
}, | ||
'VCLinkerTool': { | ||
'conditions': [ | ||
|
@@ -151,7 +155,12 @@ | |
], | ||
}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is true unconditinaly that if MSVS is used then it should not use cygwin |
||
'msvs_disabled_warnings': [4351, 4355, 4800], | ||
# 4351, 4355, 4800 - Legacy | ||
# 4244 - when passing an int64 as int, and truncation will happen | ||
# 4267 - int64 passed as int, truncation might happen (depends on linkage) | ||
# 4530 - No exception semantics (leaking from MS STL xlocale) | ||
# 4996 - winsock ip4 calls deprecated | ||
'msvs_disabled_warnings': [4351, 4355, 4800, 4244, 4267, 4530, 4996], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the exception of maybe C4351, I don't think it's a good idea to disable these warnings. And for warnings that cannot be fixed, like the ones about deprecation, it would be better to disable them in the source file using #pragma There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are here for |
||
'conditions': [ | ||
['OS == "win"', { | ||
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,10 @@ | |
'NODE_TAG="<(node_tag)"', | ||
'NODE_V8_OPTIONS="<(node_v8_options)"', | ||
], | ||
# these should not occur in `node` code. Only allowed: | ||
# 4244 - when passing an int64 as int, and truncation will happen | ||
# 4267 - int64 passed as int, truncation might happen (depends on linkage) | ||
'msvs_disabled_warnings!': [4351, 4355, 4800, 4530, 4996], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing them or hiding them per file is too noisy from my POV: |
||
|
||
'conditions': [ | ||
[ 'v8_enable_i18n_support==1', { | ||
|
@@ -322,6 +326,10 @@ | |
[ 'OS=="win"', { | ||
'sources': [ | ||
'src/res/node.rc', | ||
], | ||
# we need to use node's preferred "win32" rather than gyp's preferred "win" | ||
'defines!': [ | ||
'PLATFORM="win"', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add some comment with explanation here. |
||
], | ||
'defines': [ | ||
'FD_SETSIZE=1024', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1128,7 +1128,7 @@ void SSLWrap<Base>::OnClientHello(void* arg, | |
hello_obj->Set(env->tls_ticket_string(), | ||
Boolean::New(env->isolate(), hello.has_ticket())); | ||
hello_obj->Set(env->ocsp_request_string(), | ||
Boolean::New(env->isolate(), hello.ocsp_request())); | ||
Boolean::New(env->isolate(), hello.ocsp_request() != 0)); | ||
|
||
Local<Value> argv[] = { hello_obj }; | ||
w->MakeCallback(env->onclienthello_string(), ARRAY_SIZE(argv), argv); | ||
|
@@ -1495,7 +1495,7 @@ template <class Base> | |
void SSLWrap<Base>::IsSessionReused(const FunctionCallbackInfo<Value>& args) { | ||
HandleScope scope(args.GetIsolate()); | ||
Base* w = Unwrap<Base>(args.Holder()); | ||
bool yes = SSL_session_reused(w->ssl_); | ||
bool yes = SSL_session_reused(w->ssl_) != 0; | ||
args.GetReturnValue().Set(yes); | ||
} | ||
|
||
|
@@ -2779,11 +2779,8 @@ bool CipherBase::Update(const char* data, | |
|
||
*out_len = len + EVP_CIPHER_CTX_block_size(&ctx_); | ||
*out = new unsigned char[*out_len]; | ||
return EVP_CipherUpdate(&ctx_, | ||
*out, | ||
out_len, | ||
reinterpret_cast<const unsigned char*>(data), | ||
len); | ||
const unsigned char* cdata = reinterpret_cast<const unsigned char*>(data); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 80 column limit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. |
||
return EVP_CipherUpdate(&ctx_, *out, out_len, cdata, len) != 0; | ||
} | ||
|
||
|
||
|
@@ -2838,7 +2835,7 @@ void CipherBase::Update(const FunctionCallbackInfo<Value>& args) { | |
bool CipherBase::SetAutoPadding(bool auto_padding) { | ||
if (!initialised_) | ||
return false; | ||
return EVP_CIPHER_CTX_set_padding(&ctx_, auto_padding); | ||
return EVP_CIPHER_CTX_set_padding(&ctx_, auto_padding) != 0; | ||
} | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,11 @@ using v8::Value; | |
|
||
#define THROW_BAD_ARGS TYPE_ERROR("Bad argument") | ||
|
||
#ifdef _MSC_VER | ||
// no matching operator delete found; | ||
// memory will not be freed if initialization throws an exception | ||
#pragma warning(disable: 4291) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which line does it happen on? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a |
||
#endif | ||
class FSReqWrap: public ReqWrap<uv_fs_t> { | ||
public: | ||
void* operator new(size_t size) { return new char[size]; } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whyyyy???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please turn it off, I have already explained why it is a bad thing for node.