-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Code Checking Warnings from json.hpp on VS2017 Community #821
Comments
After closing #822, is there anything we can do here? |
Well, I think for MSVC at beginning of file we can disable these warnings temporarily and then renable them at end of the file. #elif defined(_MSC_VER)
#define JSON_DEPRECATED __declspec(deprecated)
+ #include <CppCoreCheck\Warnings.h>
+ #pragma warning(disable: ALL_CPPCORECHECK_WARNINGS)
#else
#define JSON_DEPRECATED
#endif
// end of file
+#if defined(_MSC_VER)
+ #pragma warning(default: CPPCORECHECK_CONST_WARNINGS)
+#endif Maybe something like this might work. Although it would be nice to know if the CppCoreCheck is really enabled or not. |
If we're going to do that, it would be better to use
|
Having said that, it would be good to actually fix these things where possible. Some of them are not possible, such as using |
Ah, I see. |
2.0.7 is over a year old. If you could do this same analysis on the |
Alright, I will check and see. Edit: This seems to be the results.
|
|
@AraHaan Thanks for that. My thoughts after looking at those warnings are below. @tlanc007 That warning no longer exists in the
|
I will see if I can reenable them now and recheck them for json.hpp. |
@AraHaan Any news on this? |
Currently trying to fix something on Windows itself right now that makes Visual Studio 2017 now crash due to OOM and I think it has something to do with Will comment back if I find anything on the recheck. Edit: Here is the current result.
|
Thanks! I see if I can do anything about this. |
It seems that only those warnings are left which @gregmarr already stated that there is little we can do about. |
yeah, I agree with that. The best interest is putting json.hpp in an folder that is then excluded from that code check. |
Thanks a lot for reporting. I think we can close this issue as fixing the remaining warnings is not really worth it. |
Bug Report
What is the issue you have?
A lot of warnings from code checking in Visual Studio 2017.
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
What is the expected behavior?
No annoying warnigns from json.hpp
And what is the actual behavior instead?
Warnings right after another on json.hpp.
Which compiler and operating system are you using? Is it a supported compiler?
The latest Visual Studio 2017 Community compiler.
Did you use a released version of the library or the version from the
develop
branch?Release I think of version 2.0.7
If you experience a compilation error: can you compile and run the unit tests?
Here are the warnings that are emmited on json.hpp when including and using it:
For some reason it looks like in a few places it does not like the use of
reinterpret_cast
even when things likeconst_cast
,static_cast
, ordynamic_cast
does not compile or fails.Not sure if a newer version has the warnings fixed or not so made this issue in case they have not been addressed (or suppressed).
Edit: After updating to latest release the warnings increased as well as these while processing my code that includes this before the Code Check:
The text was updated successfully, but these errors were encountered: