Skip to content

Compile warnings on MSVC 14.2 #1911

Description

@paamand

After upgrading from Visual Studio 17 to 19 i get the following compile warnings:

Warning C26451 Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).
.\nlohmann\detail\conversions\to_chars.hpp 993
(also line 997, 1007, 1009, 1017, 1021, 1036 and 1038)

Warning C26444 Avoid unnamed objects with custom construction and destruction (es.84).
.\nlohmann\detail\input\json_sax.hpp 443

Warning C28020 The expression '0<=_Param_(1)&&_Param_(1)<=400-1' is not true at this call.
.\nlohmann\detail\output\serializer.hpp 804

Warning C26451 Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2).
.\nlohmann\detail\output\serializer.hpp 810

Warning C26495 Variable 'nlohmann::basic_json<std::map,std::vector,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,bool,__int64,unsigned __int64,double,std::allocator,nlohmann::adl_serializer>::m_type' is uninitialized. Always initialize a member variable (type.6).
.\nlohmann\json.hpp 1777

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions