Bison 1.50 Errors -- Patch

Jim Gifford jim at jg555.com
Sat Oct 12 19:51:18 PDT 2002


I just received this email from one of the developers of Bison.

Thanks for the bug report.  I installed the following patch; it should
appear in the next release.

2002-10-12  Paul Eggert  <eggert at twinsun.com>

* data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
* data/glr.c, data/lalr1.cc, data/yacc.c:
Output token definitions before the first part of user declarations.
Fixes compatibility problem reported by Jim Gifford for kbd in
<http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.

Index: data/c.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/c.m4,v
retrieving revision 1.5
diff -p -u -r1.5 c.m4
--- data/c.m4 7 Sep 2002 06:31:32 -0000 1.5
+++ data/c.m4 12 Oct 2002 23:16:24 -0000
@@ -107,8 +107,7 @@ m4_define([b4_token_enum],
 m4_define([b4_token_defines],
 [m4_if([$@], [[]], [],
 [/* Tokens.  */
-#ifndef YYTOKENTYPE
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined (__STDC__) || defined (__cplusplus)
    /* Put the tokens into the symbol table, so that GDB and other debuggers
       know about them.  */
    enum yytokentype {
@@ -116,10 +115,7 @@ m4_map_sep([     b4_token_enum], [,
 ],
            [$@])
    };
-# endif
-  /* POSIX requires `int' for tokens in interfaces.  */
-# define YYTOKENTYPE int
-#endif /* !YYTOKENTYPE */
+#endif
 m4_map([b4_token_define], [$@])
 ])
 ])
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.9
diff -p -u -r1.9 glr.c
--- data/glr.c 12 Aug 2002 14:02:32 -0000 1.9
+++ data/glr.c 12 Oct 2002 23:16:25 -0000
@@ -136,10 +136,10 @@ b4_copyright([Skeleton parser for GLR pa
 #define yynerrs b4_prefix[]nerrs
 b4_location_if([#define yylloc b4_prefix[]lloc])])

-/* Copy the first part of user declarations.  */
-b4_pre_prologue
+b4_token_defines(b4_tokens)

-b4_token_defines(b4_tokens)[
+/* Copy the first part of user declarations.  */
+b4_pre_prologue[

 /* Enabling traces.  */
 #ifndef YYDEBUG
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.7
diff -p -u -r1.7 lalr1.cc
--- data/lalr1.cc 6 Sep 2002 11:54:05 -0000 1.7
+++ data/lalr1.cc 12 Oct 2002 23:16:25 -0000
@@ -104,14 +104,13 @@ b4_copyright([C++ Skeleton parser for LA
 /* Using locations.  */
 #define YYLSP_NEEDED b4_locations_flag

+b4_token_defines(b4_tokens)
+
 /* Copy the first part of user declarations.  */
 b4_pre_prologue

 /* Line __line__ of __file__.  */
 #line __oline__ "__ofile__"
-
-/* Tokens.  */
-b4_token_defines(b4_tokens)

 /* Enabling traces.  */
 #ifndef YYDEBUG
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.15
diff -p -u -r1.15 yacc.c
--- data/yacc.c 11 Oct 2002 20:53:39 -0000 1.15
+++ data/yacc.c 12 Oct 2002 23:16:25 -0000
@@ -166,10 +166,10 @@ m4_if(b4_prefix[], [yy], [],
 #define yynerrs b4_prefix[]nerrs
 b4_location_if([#define yylloc b4_prefix[]lloc])])

+b4_token_defines(b4_tokens)
+
 /* Copy the first part of user declarations.  */
 b4_pre_prologue
-
-b4_token_defines(b4_tokens)

 /* Enabling traces.  */
 #ifndef YYDEBUG

"Jim Gifford" <jim at jg555.com> wrote in message
news:p28m7xv76.ln2 at server.jg555.com...
> I have noticed a lot of errors created by Bison 1.50. Here is a list of
> packages that will not compile if Bison 1.50 is used. I have made a few
> patches to fix some of them, but not all of them.
>
> kbd-1.07 and kbd-1.06 works with Bison 1.35 but not 1.50
> Xfree 4.2.0 and Xfree 4.2.1 Patch Available
>
> I will update as my testing goes on.
>
>


-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list