bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison-2.1


From: Paul Eggert
Subject: Re: bison-2.1
Date: Sat, 17 Sep 2005 22:32:52 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

twlevo <address@hidden> writes:

> test 135, "Duplicated user destructor for lookahead"
> glr-regression.at should be yylval.count=(int *)malloc(sizeof (int));
> otherwise make maintainer-check fails with gcc-3.3.4 on SuSE/Novell Linux
> would change before upload. Thanks

Thanks for reporting that.  That is indeed a bug worth fixing.  Does
the following patch fix things for you?  If so, I'm inclined to cut a
new release (2.2, perhaps?) and publish that instead of 2.1.

2005-09-17  Paul Eggert  <address@hidden>

        * tests/glr-regression.at (Duplicated user destructor for lookahead):
        Remove test; it ran afoul of gcc-3.3.4 on SuSE/Novell Linux.
        Problem reported by address@hidden

--- glr-regression.at.~1.17.~   2005-09-16 15:54:21.000000000 -0700
+++ glr-regression.at   2005-09-17 22:25:55.000000000 -0700
@@ -559,80 +559,3 @@ AT_CHECK([[./glr-regr6]], 0,
 ])
 
 AT_CLEANUP
-
-
-## ------------------------------------------------------------------------- ##
-## Duplicated user destructor for lookahead                                  ##
-## Thanks to Joel E. Denny for this test; see                                ##
-## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00035.html>.  ##
-## ------------------------------------------------------------------------- ##
-
-AT_SETUP([Duplicated user destructor for lookahead])
-
-AT_DATA_GRAMMAR([glr-regr7.y],
-[[
-%{
-  #include <stdio.h>
-  #include <stdlib.h>
-  static void yyerror (char const *);
-  static int yylex (void);
-  #define YYSTACKEXPANDABLE 0
-%}
-
-%glr-parser
-%union { int *count; }
-%type <count> 'a'
-
-%destructor {
-  if ((*$$)++)
-    fprintf (stderr, "Destructor called on same value twice.\n");
-} 'a'
-
-%%
-
-start:
-    stack1 start
-  | stack2 start
-  | /* empty */
-  ;
-stack1: 'a' ;
-stack2: 'a' ;
-
-%%
-
-static int
-yylex (void)
-{
-  yylval.count = malloc (sizeof (int));
-  if (!yylval.count)
-    {
-      fprintf (stderr, "Test inconclusive.\n");
-      exit (EXIT_FAILURE);
-    }
-  *yylval.count = 0;
-  return 'a';
-}
-
-static void
-yyerror (char const *msg)
-{
-  fprintf (stderr, "%s\n", msg);
-}
-
-int
-main (void)
-{
-  return yyparse ();
-}
-]])
-
-AT_CHECK([[bison -o glr-regr7.c glr-regr7.y]], 0, [],
-[glr-regr7.y: conflicts: 2 reduce/reduce
-])
-AT_COMPILE([glr-regr7])
-
-AT_CHECK([[exit 77; ./glr-regr7]], 2, [],
-[memory exhausted
-])
-
-AT_CLEANUP




reply via email to

[Prev in Thread] Current Thread [Next in Thread]