diff options
| author | Quentin Carbonneaux | 2015-05-22 13:17:37 -0400 |
|---|---|---|
| committer | Quentin Carbonneaux | 2015-05-22 13:17:37 -0400 |
| commit | 3c5d1c73bd1c243b3449860dc8025d64fbc9b863 (patch) | |
| tree | 666f3826a14a798d757e2ee19ea3b93cc06890fe | |
| parent | 170e1f9248884b855e1c278f978a6a35b0faf84e (diff) | |
fix buggy %union
| -rw-r--r-- | myacc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |
