twlevo <[EMAIL PROTECTED]> writes:
> /* line 249, parse-gram.y, empty %union {} is not detected currently */
> %union { }
> %%
> prog:
> ;
> %%
>
> results in a sizeof(YYSTYPE) zero, see generated parser.
A nice test case, but I think Bison's behavior is OK here. It's not
Bison's job to verify the validity of C code, and the %union contains
C code. Some C compilers accept empty unions (GCC being one example),
and Bison shouldn't second-guess this.
Solaris 10 /usr/ccs/bin/yacc acts like Bison here, for what it's worth.