[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bison 2.1 generates bad code
From: |
Michi Henning |
Subject: |
Bison 2.1 generates bad code |
Date: |
Fri, 24 Mar 2006 13:09:00 +1000 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
I've just upgraded to Bison 2.1 and found that it generates bad code.
(The same grammar works fine with Bison 1.875b.)
The generated code contains:
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
int
yyparse ()
;
#endif
#endif
{
Note the final semicolon on the 4th-last line. It causes a syntax error
because a semicolon immediately follows the function
header, before the opening brace.
With Bison 1.875b, that semicolon wasn't generated.
Cheers,
Michi.
- Bison 2.1 generates bad code,
Michi Henning <=