mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Add --warnings-as-errors to flatc compiler. (#7034)
* Add --warnings-as-errors to flatc compiler. With this option set, flatc will return an error on parsing if any warnings occurred. * Add unit test for opts.warnings_as_errors. * Change explicit option setting to default.
This commit is contained in:
@@ -199,6 +199,7 @@ const static FlatCOption options[] = {
|
||||
"Used with \"binary\" and \"json\" options, it generates data using "
|
||||
"schema-less FlexBuffers." },
|
||||
{ "", "no-warnings", "", "Inhibit all warnings messages." },
|
||||
{ "", "warning-as-errors", "", "Treat all warnings as errors." },
|
||||
{ "", "cs-global-alias", "",
|
||||
"Prepend \"global::\" to all user generated csharp classes and "
|
||||
"structs." },
|
||||
@@ -496,6 +497,8 @@ int FlatCompiler::Compile(int argc, const char **argv) {
|
||||
opts.gen_jvmstatic = true;
|
||||
} else if (arg == "--no-warnings") {
|
||||
opts.no_warnings = true;
|
||||
} else if (arg == "--warnings-as-errors") {
|
||||
opts.warnings_as_errors = true;
|
||||
} else if (arg == "--cpp-std") {
|
||||
if (++argi >= argc)
|
||||
Error("missing C++ standard specification" + arg, true);
|
||||
|
||||
Reference in New Issue
Block a user