-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Compile warnings on MSVC 14.2 #1911
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bad bot |
json/include/nlohmann/json.hpp Line 6474 in 973c52d
Unfortunately, I didn't got this warning in my VS2019. And i think the value m_type has been initialized.
I think this is a C26444 false positive. |
Any idea how to proceed here? |
@nlohmann - I can take a look and send PR. However, I will be using the latest VS 16.5.3. Would that be okay or do you want to check for the specific VS instance? |
VS 16.5 should be compatible with older 16.X. |
Yes, PRs welcome! |
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
The text was updated successfully, but these errors were encountered: