Add flatc option to inhibit all warnings #6005 (#6301)

* Fix C/C++ Create<Type>Direct with sorted vectors

If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".

* Changes due to code review

* Improve code readability

* Add generate of JSON schema to string to lib

* option indent_step is supported

* Remove unused variables

* Fix break in test

* Fix style to be consistent with rest of the code

* Add option --no-warnings to inhibit all warnings

* Fix order of member initialization

* Add documentation for --no-warnings
This commit is contained in:
tira-misu
2020-12-10 23:03:53 +01:00
committed by GitHub
parent 92a806b4e8
commit 9fca5e4f42
4 changed files with 14 additions and 1 deletions

View File

@@ -171,6 +171,7 @@ std::string FlatCompiler::GetUsageString(const char *program_name) const {
" force vectors to empty rather than null.\n"
" --flexbuffers Used with \"binary\" and \"json\" options, it generates\n"
" data using schema-less FlexBuffers.\n"
" --no-warnings Inhibit all warning messages.\n"
"FILEs may be schemas (must end in .fbs), binary schemas (must end in .bfbs),\n"
"or JSON files (conforming to preceding schema). FILEs after the -- must be\n"
"binary flatbuffer format files.\n"
@@ -372,6 +373,8 @@ int FlatCompiler::Compile(int argc, const char **argv) {
opts.use_flexbuffers = true;
} else if (arg == "--gen-jvmstatic") {
opts.gen_jvmstatic = true;
} else if (arg == "--no-warnings") {
opts.no_warnings = true;
} else if (arg == "--cpp-std") {
if (++argi >= argc)
Error("missing C++ standard specification" + arg, true);