Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error constructor initializes _message std::string to nullptr; Visual C++ Warnings #224

Closed
ebickle opened this issue Feb 8, 2018 · 0 comments

Comments

@ebickle
Copy link

ebickle commented Feb 8, 2018

In napi-inl.h, the Error:Error constructors initialize _message to nullptr.

In Visual Studio C++ with Static Analysis enabled ('VCCLCompilerTool: { 'AdditionalOptions': ['/analyze'] } in bindings.gyp)) a warning is given that the nullptr could be zero and doesn't adhere to the specification of std::basic_string.

warning C6387: 'Param(1)' could be '0'; this does not adhere to the specification for the function 'std::basic_string<char,std::char_traits,std::allocator >::{ctor}'. Lines: 1650

_message is std::string and not a pointer; it doesn't make sense to assign a null pointer literal to it. The explicit initialization of _message should be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant