Compare commits

..
Author SHA1 Message Date
Anshul Nigham e38e7aa00c Removing _LIBCPP_DISABLE_UNUSED_STRUCT_WARNINGS from libc++ enables
`[[gnu::__warn_unused__]]` on standard library types (such as
`std::string` and `std::set`), surfacing `-Wunused-variable` warnings
in `//third_party/flatbuffers`. See [upstream LLVM commit](https://github.com/llvm/llvm-project/commit/ab8b037ef7b398aa864959a69f328fa69b567f74) for reference.

Remove unreferenced variable declarations across the code generators and
binary annotator whose initializers have no observable side effects.

PiperOrigin-RevId: 999136370
2026-10-26 16:02:57 -07:00
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -2176,6 +2176,7 @@ class JavaGenerator : public BaseGenerator {
if (field.deprecated) continue;
if (field.value.type.base_type == BASE_TYPE_UTYPE) continue;
if (field.value.type.element == BASE_TYPE_UTYPE) continue;
const auto get_field = namer_.Method("get", field);
code += " this." + namer_.Field(field) + " = ";
const auto type_name =
+1
View File
@@ -1141,6 +1141,7 @@ class SwiftGenerator : public BaseGenerator {
it != struct_def.fields.vec.end(); ++it) {
const auto& field = **it;
if (field.deprecated) continue;
const auto offset = NumToString(field.value.offset);
code_.SetValue("FIELDVAR", namer_.Variable(field));
code_.SetValue("VALUETYPE", GenerateVerifierType(field));