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

@@ -492,6 +492,15 @@ enum {
%}
%code requires {
// Only used in the %union
struct ForArgs {
int32_t start;
int32_t stop;
int32_t step;
};
}
%union
{
char symName[MAXSYMLEN + 1];
@@ -506,11 +515,7 @@ enum {
struct AlignmentSpec alignSpec;
struct DsArgList dsArgs;
struct PurgeArgList purgeArgs;
struct {
int32_t start;
int32_t stop;
int32_t step;
} forArgs;
struct ForArgs forArgs;
struct StrFmtArgList strfmtArgs;
bool captureTerminated;
}
@@ -885,7 +890,7 @@ macroargs : %empty {
$$ = macro_NewArgs();
}
| macroargs T_STRING {
macro_AppendArg(&($$), strdup($2));
macro_AppendArg($$, strdup($2));
}
;