flatbuffers.h yields several compile warnings under VS2013 Update 2 with warning level 4, both when used to compile flatc, as well as use a generated header file. Ignoring them when building flatc is less of an issue, but it'd be nice if including a generated header (which then includes flatbuffers.h) didn't force us to back off or ignore warnings.
For example, when just including a generated header (haven't actually used code from it yet):
...flatbuffers.h(410) : error C2220: warning treated as error - no 'object' file generated
...flatbuffers.h(410) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers.h(419) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data
And when compiling flatc (also some come from CPP files):
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : error C2220: warning treated as error - no 'object' file generated (...flatbuffers\src\idl_gen_text.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_gen_text.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : error C2220: warning treated as error - no 'object' file generated (...flatbuffers\src\flatc.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\flatc.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(419) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_gen_text.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(419) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\flatc.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : error C2220: warning treated as error - no 'object' file generated (...flatbuffers\src\idl_gen_cpp.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_gen_cpp.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(640) : warning C4100: 'other' : unreferenced formal parameter (...flatbuffers\src\idl_gen_text.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(419) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_gen_cpp.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(640) : warning C4100: 'other' : unreferenced formal parameter (...flatbuffers\src\flatc.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(652) : warning C4245: 'return' : conversion from 'int' to 'size_t', signed/unsigned mismatch (...flatbuffers\src\idl_gen_text.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(652) : warning C4245: 'return' : conversion from 'int' to 'size_t', signed/unsigned mismatch (...flatbuffers\src\flatc.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(640) : warning C4100: 'other' : unreferenced formal parameter (...flatbuffers\src\idl_gen_cpp.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(652) : warning C4245: 'return' : conversion from 'int' to 'size_t', signed/unsigned mismatch (...flatbuffers\src\idl_gen_cpp.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : error C2220: warning treated as error - no 'object' file generated (...flatbuffers\src\idl_gen_java.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_gen_java.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(419) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_gen_java.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(640) : warning C4100: 'other' : unreferenced formal parameter (...flatbuffers\src\idl_gen_java.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : error C2220: warning treated as error - no 'object' file generated (...flatbuffers\src\idl_parser.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(652) : warning C4245: 'return' : conversion from 'int' to 'size_t', signed/unsigned mismatch (...flatbuffers\src\idl_gen_java.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(410) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_parser.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(419) : warning C4244: 'argument' : conversion from 'flatbuffers::uoffset_t' to 'flatbuffers::voffset_t', possible loss of data (...flatbuffers\src\idl_parser.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(640) : warning C4100: 'other' : unreferenced formal parameter (...flatbuffers\src\idl_parser.cpp)
...flatbuffers\include\flatbuffers/flatbuffers.h(652) : warning C4245: 'return' : conversion from 'int' to 'size_t', signed/unsigned mismatch (...flatbuffers\src\idl_parser.cpp)
...flatbuffers\src\idl_gen_text.cpp(157) : warning C4244: 'argument' : conversion from 'const int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_gen_text.cpp(158) : warning C4244: 'argument' : conversion from 'const int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_gen_text.cpp(176) : warning C4244: 'argument' : conversion from 'int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_gen_text.cpp(204) : warning C4244: 'argument' : conversion from 'int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_parser.cpp(105) : warning C4244: 'argument' : conversion from 'int' to 'char', possible loss of data
...flatbuffers\src\idl_gen_java.cpp(81) : warning C4244: 'argument' : conversion from 'int' to 'char', possible loss of data
...flatbuffers\src\idl_gen_java.cpp(82) : warning C4244: 'argument' : conversion from 'int' to 'char', possible loss of data
...flatbuffers\src\idl_parser.cpp(371) : warning C4244: 'argument' : conversion from 'const int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_parser.cpp(417) : warning C4244: 'argument' : conversion from 'int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_parser.cpp(429) : warning C4244: 'argument' : conversion from 'int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_gen_java.cpp(376) : warning C4100: 'file_name' : unreferenced formal parameter
...flatbuffers\src\idl_gen_text.cpp(141) : warning C4244: 'argument' : conversion from 'const int' to 'flatbuffers::voffset_t', possible loss of data
...flatbuffers\src\idl_gen_text.cpp(191) : see reference to function template instantiation 'void flatbuffers::GenField<uint8_t>(const flatbuffers::FieldDef &,const flatbuffers::Table *,bool,int,int,std::string *)' being compiled
...flatbuffers\include\flatbuffers/util.h(35) : warning C4127: conditional expression is constant (...flatbuffers\src\idl_gen_cpp.cpp)
...flatbuffers\src\idl_gen_cpp.cpp(96) : see reference to function template instantiation 'std::string flatbuffers::NumToString(T)' being compiled
with
[
T=int
]
...flatbuffers\include\flatbuffers/util.h(35) : warning C4127: conditional expression is constant (...flatbuffers\src\idl_gen_java.cpp)
...flatbuffers\src\idl_gen_java.cpp(106) : see reference to function template instantiation 'std::string flatbuffers::NumToString(T)' being compiled
with
[
T=int
]
...flatbuffers\src\idl_gen_text.cpp(37) : warning C4100: 'indent_step' : unreferenced formal parameter
...flatbuffers\src\idl_gen_text.cpp(60) : see reference to function template instantiation 'void flatbuffers::Print(T,flatbuffers::Type,int,int,flatbuffers::StructDef *,std::string *)' being compiled
with
[
T=unsigned char
]
...flatbuffers\src\idl_gen_text.cpp(126) : see reference to function template instantiation 'void flatbuffers::PrintVector<uint8_t>(const flatbuffers::Vector<uint8_t> &,flatbuffers::Type,int,int,std::string *)' being compiled
...flatbuffers\src\idl_gen_text.cpp(37) : warning C4100: 'indent' : unreferenced formal parameter
...flatbuffers\src\idl_gen_text.cpp(37) : warning C4100: 'type' : unreferenced formal parameter
...flatbuffers\include\flatbuffers/util.h(35) : warning C4127: conditional expression is constant (...flatbuffers\src\idl_parser.cpp)
...flatbuffers\src\idl_parser.cpp(48) : see reference to function template instantiation 'std::string flatbuffers::NumToString<size_t>(T)' being compiled
with
[
T=size_t
]
...flatbuffers\include\flatbuffers/util.h(35) : warning C4127: conditional expression is constant (...flatbuffers\src\idl_gen_text.cpp)
...flatbuffers\src\idl_gen_text.cpp(40) : see reference to function template instantiation 'std::string flatbuffers::NumToString(T)' being compiled
with
[
T=unsigned char
]
...flatbuffers\src\idl_gen_text.cpp(60) : see reference to function template instantiation 'void flatbuffers::Print(T,flatbuffers::Type,int,int,flatbuffers::StructDef *,std::string *)' being compiled
with
[
T=unsigned char
]