commit 8235a81c8f7f58eaa08655147963936a2290f691 from: Omar Polo date: Tue Jun 29 11:11:43 2021 UTC give a name to the anonymous union commit - 0be2a537e6e2b336a6e46cd1f5a13663ea939ea4 commit + 8235a81c8f7f58eaa08655147963936a2290f691 blob - 0f17cb25a395684e3fb00623527627a0293a315c blob + 257744d671551fc2933fcb491e02efaea1792994 --- parse.y +++ parse.y @@ -31,7 +31,7 @@ typedef struct { union { char *str; int num; - }; + } v; int lineno; int colno; } yystype; @@ -77,9 +77,9 @@ void add_param(char *, char *, int); %token TERR -%token TSTRING -%token TNUM -%token TBOOL +%token TSTRING +%token TNUM +%token TBOOL %% @@ -453,20 +453,20 @@ eow: } c = *buf; if (!nonkw && (c == '-' || isdigit(c))) { - yylval.num = parse_portno(buf); + yylval.v.num = parse_portno(buf); return TNUM; } if (!nonkw && !strcmp(buf, "on")) { - yylval.num = 1; + yylval.v.num = 1; return TBOOL; } if (!nonkw && !strcmp(buf, "off")) { - yylval.num = 0; + yylval.v.num = 0; return TBOOL; } if ((str = strdup(buf)) == NULL) err(1, "%s", __func__); - yylval.str = str; + yylval.v.str = str; return TSTRING; eof: