Skip to content

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

Closed

Description

@ebickle

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions