Skip to content

Commit

Permalink
Fixed initialization of std::string to nullptr
Browse files Browse the repository at this point in the history
Enabled VC++ static analysis

PR-URL: #228
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
  • Loading branch information
ebickle authored and mhdawson committed Mar 1, 2018
1 parent 9c4d321 commit faf19c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ inline NAPI_NO_RETURN void Error::Fatal(const char* location, const char* messag
napi_fatal_error(location, NAPI_AUTO_LENGTH, message, NAPI_AUTO_LENGTH);
}

inline Error::Error() : ObjectReference(), _message(nullptr) {
inline Error::Error() : ObjectReference() {
}

inline Error::Error(napi_env env, napi_value value) : ObjectReference(env, nullptr) {
Expand Down
10 changes: 8 additions & 2 deletions test/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
'VCCLCompilerTool': {
'ExceptionHandling': 1,
'EnablePREfast': 'true',
},
},
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
Expand All @@ -47,7 +50,10 @@
'cflags': [ '-fno-exceptions' ],
'cflags_cc': [ '-fno-exceptions' ],
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 0 },
'VCCLCompilerTool': {
'ExceptionHandling': 0,
'EnablePREfast': 'true',
},
},
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
Expand Down

0 comments on commit faf19c4

Please sign in to comment.