No more flexible array members (not standard C++) (#1307)

* Replace FAMs with `std::vector`s (or one `std::string`) in four `struct`s

* Anonymous types declared in an anonymous union are also non-standard
  Only Clang complains about this (-Wnested-anon-types)
This commit is contained in:
Sylvie
2024-02-22 16:22:37 -05:00
committed by GitHub
parent 6d29d2a67e
commit c0d534f5ad
12 changed files with 170 additions and 203 deletions

View File

@@ -457,14 +457,14 @@ static void writeFileStackNode(struct FileStackNode const *node, FILE *f)
putlong(node->lineNo, f);
putc(node->type, f);
if (node->type != NODE_REPT) {
putstring(((struct FileStackNamedNode const *)node)->name, f);
putstring(((struct FileStackNamedNode const *)node)->name->c_str(), f);
} else {
struct FileStackReptNode const *reptNode = (struct FileStackReptNode const *)node;
putlong(reptNode->reptDepth, f);
putlong(reptNode->iters->size(), f);
// Iters are stored by decreasing depth, so reverse the order for output
for (uint32_t i = reptNode->reptDepth; i--; )
putlong(reptNode->iters[i], f);
for (uint32_t i = reptNode->iters->size(); i--; )
putlong((*reptNode->iters)[i], f);
}
}