-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix high certainty warnings from PVS-studio #5115
Conversation
- Introduced FLATBUFFERS_ATTRIBUTE macro to use [[attribute]] if modern C++ compiler used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This seems to have caught some small but actual bugs, too!
include/flatbuffers/base.h
Outdated
@@ -59,6 +59,15 @@ | |||
// Clang 3.4 and later implement all of the ISO C++ 2014 standard. | |||
// http://clang.llvm.org/cxx_status.html | |||
|
|||
// MSVC note: requires `/Zc:__cplusplus` or use _MSVC_LANG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the consequences of this? I don't think we want to require our users to specify this flag for things to work correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Ok, thanks! |
@vglavnyy can you email me? |
- GCC: fixed broken `fallthrough` (checked with 7.3 and 8.2) - Clang: added `fallthrough` support - Clang: added `-Wimplicit-fallthrough` checking
- GCC: fixed broken `fallthrough` (checked with 7.3 and 8.2) - Clang: added `fallthrough` support - Clang: added `-Wimplicit-fallthrough` checking
- GCC: fixed broken `fallthrough` (checked with 7.3 and 8.2) - Clang: added `fallthrough` support - Clang: added `-Wimplicit-fallthrough` checking
* Fix high certainty warnings from PVS-studio - Introduced FLATBUFFERS_ATTRIBUTE macro to use [[attribute]] if modern C++ compiler used * Update the note about __cplusplus usage in the MSVC
- GCC: fixed broken `fallthrough` (checked with 7.3 and 8.2) - Clang: added `fallthrough` support - Clang: added `-Wimplicit-fallthrough` checking
It was replaced by size() in google/flatbuffers@96592d5d and deprecated in google/flatbuffers#5115 ref:a1bb5b6bb8e2d38b8332fe3b22818770cb60f9a4
It was replaced by size() in google/flatbuffers@96592d5d and deprecated in google/flatbuffers#5115 ref:a1bb5b6bb8e2d38b8332fe3b22818770cb60f9a4
It was replaced by size() in google/flatbuffers@96592d5d and deprecated in google/flatbuffers#5115 ref:a1bb5b6bb8e2d38b8332fe3b22818770cb60f9a4
The Flatbuffers has checked with the PVS-studio static code analyzer.
This PR fixes several high certainty warnings and introduces
FLATBUFFERS_ATTRIBUTE
macro definition.The
FLATBUFFERS_ATTRIBUTE
temporary disabled until the deprecatedVector::Length()
is not resolved.Unexpected changes: some source lines modified by removing trailing whitespaces on file save.
Need to revert them back?