mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 13:08:58 +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:
@@ -591,6 +591,7 @@ struct IDLOptions {
|
||||
std::string filename_suffix;
|
||||
std::string filename_extension;
|
||||
bool no_warnings;
|
||||
bool warnings_as_errors;
|
||||
std::string project_root;
|
||||
bool cs_global_alias;
|
||||
bool json_nested_flatbuffers;
|
||||
@@ -681,6 +682,7 @@ struct IDLOptions {
|
||||
filename_suffix("_generated"),
|
||||
filename_extension(),
|
||||
no_warnings(false),
|
||||
warnings_as_errors(false),
|
||||
project_root(""),
|
||||
cs_global_alias(false),
|
||||
json_nested_flatbuffers(true),
|
||||
@@ -787,6 +789,7 @@ class Parser : public ParserState {
|
||||
root_struct_def_(nullptr),
|
||||
opts(options),
|
||||
uses_flexbuffers_(false),
|
||||
has_warning_(false),
|
||||
advanced_features_(0),
|
||||
source_(nullptr),
|
||||
anonymous_counter_(0),
|
||||
@@ -1021,6 +1024,7 @@ class Parser : public ParserState {
|
||||
|
||||
IDLOptions opts;
|
||||
bool uses_flexbuffers_;
|
||||
bool has_warning_;
|
||||
|
||||
uint64_t advanced_features_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user