[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: assert failure at line 1896
From: |
Paul Eggert |
Subject: |
Re: assert failure at line 1896 |
Date: |
Sat, 20 May 2006 21:53:43 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Derek M Jones <address@hidden> writes:
> There are also various
> warnings about argument 3 being an incompatible pointer type (the
> more obvious fix).
Thanks for reporting this. I guess we'll need a Bison 2.3 soon, alas.
I installed the following to fix the warnings.
The core dump is another story. Joel E. Denny said he'll install a
patch (I hope soon....).
2006-05-20 Paul Eggert <address@hidden>
* data/c.m4 (b4_yy_symbol_print_generate):
(b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
'const YYSTYPE', and similarly for YYLTYPE. This fixes one
of the bugs reported today by Derek M Jones in
<http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
* doc/bison.texinfo (Value Type): Document that YYSTYPE must be
defined to be a type name without parens or brackets.
(Location Type): Similarly for YYLTYPE.
* tests/regression.at (Trivial grammars): Put in a test for this
bug that will be caught by 'make maintainer-check' (though not,
alas, by 'make check' unless your compiler is picky).
Index: data/c.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/c.m4,v
retrieving revision 1.55
diff -p -u -r1.55 c.m4
--- data/c.m4 14 May 2006 20:40:33 -0000 1.55
+++ data/c.m4 21 May 2006 04:36:58 -0000
@@ -483,8 +483,8 @@ m4_define_default([b4_yy_symbol_print_ge
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
- [[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
-b4_locations_if([, [[const YYLTYPE * const yylocationp], [yylocationp]]])[]dnl
+ [[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
+b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
if (!yyvaluep)
@@ -515,8 +515,8 @@ b4_parse_param_use[]dnl
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
- [[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
-b4_locations_if([, [[const YYLTYPE * const yylocationp], [yylocationp]]])[]dnl
+ [[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
+b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
if (yytype < YYNTOKENS)
Index: doc/bison.texinfo
===================================================================
RCS file: /cvsroot/bison/bison/doc/bison.texinfo,v
retrieving revision 1.188
diff -p -u -r1.188 bison.texinfo
--- doc/bison.texinfo 14 May 2006 21:00:37 -0000 1.188
+++ doc/bison.texinfo 21 May 2006 04:36:59 -0000
@@ -3067,6 +3067,8 @@ specify some other type, define @code{YY
@end example
@noindent
address@hidden's replacement list should be a type name
+that does not contain parentheses or square brackets.
This macro definition must go in the prologue of the grammar file
(@pxref{Grammar Outline, ,Outline of a Bison Grammar}).
@@ -3463,7 +3465,9 @@ actions to take when rules are matched.
Defining a data type for locations is much simpler than for semantic values,
since all tokens and groupings always use the same type.
-The type of locations is specified by defining a macro called @code{YYLTYPE}.
+You can specify the type of locations by defining a macro called
address@hidden, just as you can specify the semantic value type by
+defining @code{YYSTYPE} (@pxref{Value Type}).
When @code{YYLTYPE} is not defined, Bison uses a default structure type with
four members:
Index: tests/regression.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/regression.at,v
retrieving revision 1.97
diff -p -u -r1.97 regression.at
--- tests/regression.at 15 May 2006 06:13:53 -0000 1.97
+++ tests/regression.at 21 May 2006 04:36:59 -0000
@@ -31,6 +31,7 @@ AT_DATA_GRAMMAR([input.y],
[[%{
void yyerror (char const *);
int yylex (void);
+#define YYSTYPE int *
%}
%error-verbose
@@ -42,6 +43,7 @@ program: 'x';
AT_CHECK([bison -o input.c input.y])
AT_COMPILE([input.o], [-c input.c])
+AT_COMPILE([input.o], [-DYYDEBUG -c input.c])
AT_CLEANUP
- Re: assert failure at line 1896, (continued)
Re: assert failure at line 1896, Akim Demaille, 2006/05/29
Re: assert failure at line 1896, Paul Eggert, 2006/05/30
Re: assert failure at line 1896, Joel E. Denny, 2006/05/30
Re: assert failure at line 1896,
Paul Eggert <=