[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yacc.c: Extracting yysyntax_error
From: |
Paul Eggert |
Subject: |
Re: yacc.c: Extracting yysyntax_error |
Date: |
Mon, 19 Sep 2005 16:23:46 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Akim Demaille <address@hidden> writes:
> yysyntax_error needs no additional argument, because it's `error' that
> might need some. That's indeed, in retrospect, a good reason not to
> leave the call to error to yysyntax_error.
Unfortunately it's more complicated than that. First, yysyntax_error
might return alloca storage, which is a no-no. Second, if
YYERROR_VERBOSE is not defined, yysyntax_error's args are not used,
and many compilers warn about this.
There's one more problem while we're in the area: a memory leak if
if YYSTACK_USE_ALLOCA is in effect. Each syntax error uses up
more stack space.
I've drafted a patch to fix these problems, but have not yet had time
to test it. I'll try to do it soon.
- Re: yacc.c: Extracting yysyntax_error, Paul Eggert, 2005/09/20
- Re: yacc.c: Extracting yysyntax_error, Akim Demaille, 2005/09/20
- Re: yacc.c: Extracting yysyntax_error, Paul Eggert, 2005/09/20
- Re: yacc.c: Extracting yysyntax_error, Hans Aberg, 2005/09/21
- Re: yacc.c: Extracting yysyntax_error, Akim Demaille, 2005/09/21
- Re: yacc.c: Extracting yysyntax_error, Hans Aberg, 2005/09/21
- Re: yacc.c: Extracting yysyntax_error, Paul Eggert, 2005/09/21
- Re: yacc.c: Extracting yysyntax_error, Hans Aberg, 2005/09/21
- Re: yacc.c: Extracting yysyntax_error, Hans Aberg, 2005/09/22