Fix high certainty warnings from PVS-studio (#5115)

* 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
This commit is contained in:
Vladimir Glavnyy
2019-01-18 00:49:27 +07:00
committed by Wouter van Oortmerssen
parent bbfd12eb11
commit d44931656a
8 changed files with 49 additions and 25 deletions

View File

@@ -44,7 +44,7 @@ int main(int /*argc*/, const char * /*argv*/[]) {
flatbuffers::Parser parser1;
ok = parser1.Parse(schema_file.c_str(), include_directories);
assert(ok);
// inizialize parser by deserializing bfbs schema
flatbuffers::Parser parser2;
ok = parser2.Deserialize((uint8_t *)bfbs_file.c_str(), bfbs_file.length());
@@ -52,6 +52,7 @@ int main(int /*argc*/, const char * /*argv*/[]) {
// parse json in parser from fbs and bfbs
ok = parser1.Parse(json_file.c_str(), include_directories);
assert(ok);
ok = parser2.Parse(json_file.c_str(), include_directories);
assert(ok);