summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2015-05-22 13:17:37 -0400
committerQuentin Carbonneaux2015-05-22 13:17:37 -0400
commit3c5d1c73bd1c243b3449860dc8025d64fbc9b863 (patch)
tree666f3826a14a798d757e2ee19ea3b93cc06890fe
parent170e1f9248884b855e1c278f978a6a35b0faf84e (diff)
fix buggy %union
-rw-r--r--myacc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/myacc.c b/myacc.c
index 13cae7e..52fd891 100644
--- a/myacc.c
+++ b/myacc.c
@@ -957,10 +957,10 @@ getdecls()
die("syntax error, { expected after %union");
fprintf(fout, "#line %d \"%s\"\n", lineno, srca);
s = cpycode();
- fprintf(fout, "union yyunion %s;\n", s);
+ fprintf(fout, "typedef union %s yyunion;\n", s);
fprintf(fout, "#define YYSTYPE yyunion\n");
if (fhdr) {
- fprintf(fhdr, "union yyunion %s;\n", s);
+ fprintf(fhdr, "typedef union %s yyunion;\n", s);
fprintf(fhdr, "#define YYSTYPE yyunion\n");
}
free(s);