diff --git a/include/flatbuffers/util.h b/include/flatbuffers/util.h index ba73d67bd..f3fbef497 100644 --- a/include/flatbuffers/util.h +++ b/include/flatbuffers/util.h @@ -210,6 +210,9 @@ inline void EnsureDirExists(const std::string &filepath) { auto parent = StripFileName(filepath); if (parent.length()) EnsureDirExists(parent); #ifdef _WIN32 + #ifdef _MSC_VER + #pragma warning(suppress: 6031) + #endif _mkdir(filepath.c_str()); #else mkdir(filepath.c_str(), S_IRWXU|S_IRGRP|S_IXGRP); diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index b533d213e..91ada0e6d 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -191,7 +191,7 @@ std::string Parser::TokenToStringId(int t) { // Parses exactly nibbles worth of hex digits into a number, or error. CheckedError Parser::ParseHexNum(int nibbles, int64_t *val) { for (int i = 0; i < nibbles; i++) - if (!isxdigit(cursor_[i])) + if (!isxdigit(static_cast(cursor_[i]))) return Error("escape code must be followed by " + NumToString(nibbles) + " hex digits"); std::string target(cursor_, cursor_ + nibbles); @@ -214,7 +214,7 @@ CheckedError Parser::Next() { case '{': case '}': case '(': case ')': case '[': case ']': case ',': case ':': case ';': case '=': return NoError(); case '.': - if(!isdigit(*cursor_)) return NoError(); + if(!isdigit(static_cast(*cursor_))) return NoError(); return Error("floating point constant can\'t start with \".\""); case '\"': case '\'':