mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
Fixed "unused private field" warning for clang.
Bug: 17095037 Change-Id: Iedbe56f6ddc0ba7876896b0bb7ed9da8e6a85f7e Tested: on Linux & OS X.
This commit is contained in:
@@ -376,7 +376,16 @@ static void GenStruct(StructDef &struct_def, std::string *code_ptr) {
|
||||
if (field.padding)
|
||||
code += ", __padding" + NumToString(padding_id++) + "(0)";
|
||||
}
|
||||
code += " {}\n\n";
|
||||
code += " {";
|
||||
padding_id = 0;
|
||||
for (auto it = struct_def.fields.vec.begin();
|
||||
it != struct_def.fields.vec.end();
|
||||
++it) {
|
||||
auto &field = **it;
|
||||
if (field.padding)
|
||||
code += " (void)__padding" + NumToString(padding_id++) + ";";
|
||||
}
|
||||
code += " }\n\n";
|
||||
|
||||
// Generate accessor methods of the form:
|
||||
// type name() const { return flatbuffers::EndianScalar(name_); }
|
||||
|
||||
Reference in New Issue
Block a user